The Events Calendar
[resolved] Displaying Current month & year on Events Calendar (10 posts)

  1. Kevin Kwok
    Posted 2 years ago #

    Love the plugin, however I cannot figure out how to display the current month and year as plain text. I know by default it shows the current month and year currently in view via a drop down. I want to figure out what I need to do to get this in plain text. Does anyone know how to do this?


  2. Kevin Kwok
    Posted 2 years ago #

    I found this via their website:

    Current Month Date
    Returns a formatted date string of the currently displayed month (in "jump to month" mode)

    More Info
    return: Name of the displayed month.
    since: 2.0

    SO I ended up putting this in my grid.php file (found at plugin folder/views/gridview.php)

    <h1><?php tribe_get_displayed_month(); ?></h1>

    NOTHING appears...

  3. Kevin Kwok
    Posted 2 years ago #

    HAR HAR. i missed echo

    <h1><?php echo tribe_get_displayed_month(); ?></h1>

    and like the wordpress forums intended, users will talk to themselves and figure it out. Thanks for the stage and time wordpress. Once again I shamed myself. Hope this helps someone in the future.

  4. kshapiro
    Posted 2 years ago #

    Thank you very much for posting what you found! This helped me tremendously!

  5. Rob La Gatta
    Modern Tribe Support
    Plugin Author

    Posted 2 years ago #

    Big thanks here, Kevin Kwok! We really appreciate you taking the time to come back and post this, and as you can see, at least kshapiro found it valuable. Cheers...if you're ever interested in going PRO, shoot us an email (pro /a/ tri.be) and we'll see if we've got any open coupon codes we can hook you up with.

  6. sqrlstogy
    Posted 2 years ago #

    Did you figure out how to get the year to display? I have the month but the year is giving me some issues.

  7. kshapiro
    Posted 2 years ago #

    I just used <?php echo tribe_get_displayed_month(); ?> and it echos the month and the year.

  8. jonahcoyote
    Posted 2 years ago #

    Thanks for the follow up and solution kshapiro!

  9. j3ddesign
    Posted 1 year ago #

    Jumping in on this a little bit late.
    I had the exact same problem however managed to sort it out using the details here and also a bit of googling.

    For future browsers, the code I came up with is:

    $curryear = substr(tribe_get_displayed_month(), -4);
    $currmonth = substr(tribe_get_displayed_month(), -0, -4);
    echo $curryear;
    echo $currmonth;
  10. Rob La Gatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Greatly appreciate the follow-up here, j3ddesign, in case anyone else finds themselves in a similar position down the road. Cheers :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • The Events Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic