Support » Plugin: Simple Calendar - Google Calendar Plugin » PHP Embeded code advice

  • Resolved Brewmaster9

    (@brewmaster9)


    I currently have the following code embeddeed on my homepage. I need to replace, as it now won’t work with Simple Calendar. The rest of my pages are ok, as they are created directly with WordPress.

    <h3 class=”events_hdr”>Upcoming events…</h3>
    <?php echo do_shortcode( ‘[google-calendar-events id=”1, 2, 3″ type=”list” title=”Events on” max=”4″]’ ); ?>

    regards
    Graham

    https://wordpress.org/plugins/google-calendar-events/

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Contributor Nick Young

    (@nickyoung87)

    Ok so it looks like you have a grouped calendar. You will need to go into the calendars and create a new grouped calendar and set the calendars it uses there. You can do this in Calendars > Add New > (settings at bottom) Event Source -> Grouped Calendars.

    Then you will set the calendars from the “Grouped Calendars” section in the calendar settings.

    You can then change the “View” to be list. Then you can adjust the other settings to get the list to only show 4 events.

    After you do that you can save it and then copy the new shortcode and paste that into your PHP and it should work.

    Hi Nick, I got as far as creating a group calendar and the short code works on my pages created within WordPress without a problem. However, my homepage is a bespoke themed static page and I can’t seem to get the short code to work. I must be using the wrong syntax? How do I call the correct short code? I can’t find it in the documentation. The original short code was called via google-calendar-events.

    Regards
    Graham

    Plugin Contributor Nick Young

    (@nickyoung87)

    The shortcode that is running in the do_shortcode() command you posted is incorrect. You need to replace that shortcode with the new one.

    Hi Nick, Sorry I think we are at cross purposes. I have modified the above code to:
    <?php echo do_shortcode(‘[calendar id 6966]’); ?>

    This doesn’t appear to work on my Static Page. It works with my pages and posts within wordpress. Am I missing something?

    Regards
    Graham

    I forgot the “” [calendar id=”6966″], but still no joy

    Plugin Contributor Nick Young

    (@nickyoung87)

    Can you post a link to the page so I can give it a look?

    Thanks

    I had the same problem when I tried to use:

    <?php echo do_shortcode('[calendar id="12"]'); ?>

    to print it in my theme. In looking at the following file:

    includes/shortcodes.php I found the following conditional (Line #66):

    if ( is_singular() && $id > 0 ) {
    
    }

    Removing the following got it to work for me:

    is_singular() &&

    Nick, my homepage is:

    http://leedscityac.org/wordpress/

    The grouped calendar should appear below “Upcoming events” on the right hand side OD the page. There is a link to a page below this that shows the grouped calendar on a separate WordPress Paige, which works.

    Jeff, I’ll try that, but will wait for Nick’s reply, in case there is a bugfix.

    Update. Just updated to latest version, but problem still exixted.

    I’ve applied jeffsyl fix to my theme and it works

    Many thanks….

    Update,

    The theme fix above affects single calendar on other pages, so not a universal fix. I’m reverting back as I use single calendars on a few pages on my site. I’ll await further developments to see if there is a universal fix to the plugin.

    Plugin Contributor Nick Young

    (@nickyoung87)

    Thanks for all the extra information. I have marked this as a bug to look into. Thanks!

    Plugin Contributor Nick Young

    (@nickyoung87)

    This should be fixed if you are running the latest version of 3.0.9.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘PHP Embeded code advice’ is closed to new replies.