Month specific gridview title

Home Forums Calendar Products Events Calendar PRO Month specific gridview title

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #19701
    Michelle
    Participant

    Hi – I am using the twenty-ten theme (&ECP Pro & Current WP install) and would like the title of my calendar gridview and listview to be ‘Events for (current month), 2012’ – so that the main title (just above the month selector) changes according to the month being viewed. Can I hardcode this into the ecp-page-template.php and if so what would be the code?
    Thanks!

    #19714
    Rob
    Member

    Hi Michelle. Thanks for reaching out, and for your report of this. If I understand correctly what you’re going for, you should be able to accomplish what you’re going for by adding the following code to your functions.php:

    add_filter(‘tribe_get_events_title’, ‘my_get_events_title’);
    function my_get_events_title($title){
    if( is_tax() ){
    return $title;
    }else{
    return ‘My Title’;
    }
    }

    “My Title” would be renamed for the “Events for (current month) 2012.” You should be able to get what you need for the current month from the WordPress date/time codex (http://codex.wordpress.org/Formatting_Date_and_Time), but let me know if you have problems from there or if I’ve misunderstood the issue here.

    #19744
    Michelle
    Participant

    Hi Rob – Thanks that works except I can’t work out what the right context is to return the current month in ‘My Title’. I tried ‘Events for [month], [year]’; as well as ‘Events for but these don’t work.

    #19745
    Michelle
    Participant

    Also tried ‘Events for ‘ ;

    #19746
    Michelle
    Participant

    sorry my code didn’t paste – tried putting in ‘Events for then the php the_time string also.

    #19762
    javier
    Participant

    Hi Michelle and Rob!
    I have copied the code and inserted it in the function.php, but it gives me an error with an unexpected T_STRING in the penultimate line. Why is this??

    I’ll wait for Michelle’s question to be answered to know how to do that too. Thanks!! 😉

    #19809
    Rob
    Member

    Hey guys. Thanks for the follow-up here; while I’m not sure about this one myself, I’ve asked Jonah to take a look when he hits the forums later today. Stay tuned and thanks for your patience thus far.

    #19886
    Jonah
    Participant

    @Michelle – I’ve followed up via email so look for my reply there.


    @Javier
    – make sure the code uses single quotes and not apostrophes like so:

    add_filter('tribe_get_events_title', 'my_get_events_title');
    function my_get_events_title($title){
    if( is_tax() ) {
    return $title;
    } else {
    return 'My Title';
    }
    }

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Month specific gridview title’ is closed to new replies.