Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi Frederic – does this post from the Events Calendar PRO forum help at all?

    Thread Starter Frederic Legrand

    (@fredericlegrand)

    did tried but no luck
    is filter correct?

    add_filter(‘tribe_events_the_mini_calendar_title’, ‘change_minical_title_month_format’);

    function change_minical_title_month_format($title) {
    return str_replace(‘September’, ‘Sept’, $title);
    }

    That basically looks correct. I’m not sure why it isn’t working for you but, unfortunately, I’m afraid we’ll have to leave it to you to figure out the rest – hopefully though that gives you a starting point to play with.

    It could be worth double checking that it is located appropriately within your theme’s functions.php file (if that is where you put it).

    Thread Starter Frederic Legrand

    (@fredericlegrand)

    I am placing it on bottom of thew theme function
    but no luck

    Thread Starter Frederic Legrand

    (@fredericlegrand)

    add_filter(‘tribe_events_the_mini_calendar_title’, ‘change_minical_title_month_format’);

    function change_minical_title_month_format($title) {
    return str_replace(‘September’, ‘Sept’, $title);
    }
    just add to replace filter to:
    tribe_events_event_schedule_details

    Thread Starter Frederic Legrand

    (@fredericlegrand)

    add_filter(‘tribe_events_event_schedule_details’, ‘change_minical_title_month_format’);

    now if I want to add a list?
    with one month it works but who to do it all

    function change_minical_title_month_format($title) {
    return str_replace(‘January’, ‘Jan’, $title);
    return str_replace(‘February’, ‘Feb’, $title);
    return str_replace(‘March’, ‘Mar’, $title);
    return str_replace(‘April’, ‘Apr’, $title);
    return str_replace(‘May’, ‘MAy’, $title);
    return str_replace(‘June’, ‘Jun’, $title);
    return str_replace(‘July’, ‘Jul’, $title);
    return str_replace(‘August’, ‘Aug’, $title);
    return str_replace(‘September’, ‘Sept’, $title);
    return str_replace(‘October’, ‘Oct’, $title);
    return str_replace(‘November’, ‘Nov’, $title);
    return str_replace(‘December’, ‘Dec’, $title);
    }

    Hi Frederic, I think you would benefit from something like a switch control structure. As it stands, no code within your function will run after the first return statement.

    It’s been a while so I’ll mark this thread as resolved (it’s also more a general PHP/WP dev question than anything else). Thanks!

    Thread Starter Frederic Legrand

    (@fredericlegrand)

    add_filter(‘tribe_events_event_schedule_details’, ‘change_minical_title_month_format’);

    function change_minical_title_month_format($title) {
    $title = str_replace(‘January’, ‘Jan’, $title);
    $title = str_replace(‘February’, ‘Feb’, $title);
    $title = str_replace(‘March’, ‘Mar’, $title);
    $title = str_replace(‘April’, ‘Apr’, $title);
    $title = str_replace(‘June’, ‘Jun’, $title);
    $title = str_replace(‘July’, ‘Jul’, $title);
    $title = str_replace(‘August’, ‘Aug’, $title);
    $title = str_replace(‘September’, ‘Sep’, $title);
    $title = str_replace(‘October’, ‘Oct’, $title);
    $title = str_replace(‘November’, ‘Nov’, $title);
    $title = str_replace(‘December’, ‘Dec’, $title);
    return $title;
    }

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘widget month adbreviation’ is closed to new replies.