1

I am using the latest version of the My Calendar plugin by Joe Dolson with the latest version of WP. I want to output an events list in a particular place in my code, but I can't seem to find any way to do this. The only thing I've found regarding output is by using shortcodes in the post/page.

I guess theoretically I could add a new sidebar widget and then add the templates that way. Then put the sidebar where I want in the code, but this poses two problems: 1. It's a hassle 2. I don't want my clients to be able to move or change this. I'd like to have it set and stay that way.

I'm having some trouble finding the answers to this question. It seems like it would be possible, because most plugins I've used have an option to add output directly in the template code, but I can't seem to find the answer.

Thanks in advance!

1 Answer 1

1

You can use the function do_shortcode in your template to output the content generated by the shortcode that My Calendar provides for listing events.

For an example, to show a list of upcoming events use something like:

<?php echo do_shortcode('[my_calendar_upcoming before="3" after="3" type="event" fallback="No events coming up!" category="General" template="{title} {date}" order="asc" skip="0"]'); ?>

Take note of the use of single quotes for the function and double quotes for the shortcode attributes.

1
  • Thanks! This was actually in the FAQs and I totally missed it. Feb 24, 2012 at 17:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.