• Resolved Anonymous User 12673376

    (@anonymized-12673376)


    Hi !
    Thank you for your amazing and so useful plugin !
    I need to get the category id of the current category page in order to use it in the calendar shortcode but I don’t know how to do…

    <?php
    echo do_shortcode(‘[events_calendar long_events=1 full=1 category=”#_CATEGORYID”]’);
    ?>

    Many thanks in advance for helping me !!!
    Jean David

Viewing 2 replies - 1 through 2 (of 2 total)
  • Using a placeholder in php will never work.

    Try this (untested):

    <?php
    global $EM_Event;
    $category_id = $EM_Event->output("#_CATEGORYID");
    
    echo do_shortcode( '[events_calendar category="'. $category_id .'"]' );
    ?>
    Thread Starter Anonymous User 12673376

    (@anonymized-12673376)

    Thank you so much !

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘How to get category id ?’ is closed to new replies.