WordPress.org

Ready to get started?Download WordPress

Forums

The Events Calendar
[resolved] [closed] Events Page Title (34 posts)

  1. chloej
    Member
    Posted 2 years ago #

    I'm using this plugin here - http://www.regimentfitness.co.uk/eventspage/ (the page isn't live yet so I'm still playing around with it).

    The plugin is great but the one issue I can't solve is that the page title in the list view isn't "Events" or "Events Page" as I have specified in the page I've created, but instead the page takes the title of the first event. I'm presuming that this is because the plugin doesn't actually use an existing page but rather creates one so there is actually no page title specified. There must be a way to change this but I can't find anywhere in the template files!

    Would appreciate some help.

    Thanks

    http://wordpress.org/extend/plugins/the-events-calendar/

  2. luizamcf
    Member
    Posted 2 years ago #

    I´m having the same problem.
    http://flamencobrasil.com.br/agenda/

  3. jonahcoyote
    Member
    Posted 2 years ago #

    Unfortunately there's no easy way to do this. Depending on what theme you're using you'll need to figure out how to filter the page title and then conditionally change the title using:

    tribe_is_month() - to detect when you're viewing the calendar grid

    and

    tribe_is_event() && !tribe_is_day() && !is_single() - to detect when you're viewing the events list.

    Hopefully that helps.

  4. chloej
    Member
    Posted 2 years ago #

    That all seems a bit longwinded for a php novice!

    In the end I just modified the page title code in my main page template to check for the events page id so that I could hard code the "Events" title into just that page. Unfortunately that means that the page title for each individual event is still "Our Events" as on the main page.

    <?php if (is_page('472')) { ?>
    <h1>Our Events</h1>
    <? } else { ?>
    <h1><?php the_title(); ?></h1>
    <?php } ?>

    Is there really not a better, easier way to do this?! Got to say it's a glaring hole in an otherwise great plugin.

  5. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 2 years ago #

    Thanks for the feedback, chloej. We've had a number of requests similar to yours since launching 2.0, so it's quite likely this will be changing for a future release (2.1 or later). Apologies for the inconvenience in the interim.

  6. Henry
    Member
    Posted 2 years ago #

    <?php if(tribe_is_upcoming()){ ?>
    <h1 class="home">Upcoming events</h1>
    <?php }elseif(tribe_is_past()){ ?>
    <h1 class="home">Past events</h1>
    <?php } ?>

    This will work nicely on list.php

  7. jonahcoyote
    Member
    Posted 2 years ago #

    Here's the stack of conditional blocks for most all the event based pages that should help:

    if(tribe_is_month()) {
        echo 'Calendar Grid';
    } else if(tribe_is_event() && !tribe_is_day() && !is_single()) {
        echo 'Event List';
    } else if(tribe_is_event() && !tribe_is_day() && is_single()) {
    	echo 'Single Event';
    } else if(tribe_is_day()) {
        echo 'Single Day';
    } else {
    	the_title();
    }
  8. metalmusicman
    Member
    Posted 2 years ago #

    Thanks for the above code, worked like a charm!

  9. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 2 years ago #

    Excellent to hear that did the trick, metalmusicman. If you need anything else down the road please let us know and we'll do what we can to help. Thanks for your support & using the plugin!

  10. radimusprime
    Member
    Posted 2 years ago #

    Hi @roblagatta I don't think i get it yet :)

    In U-Design, the header file is controlling how the title is set. The code for page-title looks like:

    <div id="page-content-title">
    		<div id="page-content-header" class="container_24">
    		    <div id="page-title">
    <?php 			$post = $posts[0]; // Hack. Set $post so that the_date() works.
    			if (is_page()) : ?>
    			    <h1><?php the_title(); ?></h1>
    <?php			elseif ( is_single() ) : ?>
    			    <h1><?php the_title(); ?></h1>
    <?php			elseif (is_tax()) : /* If this is a taxonomy archive */
    			    $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );  ?>
    			    <h1 class="pagetitle"><?php echo ucwords( $term->taxonomy ) . ': ' . $term->name; ?></h1>
    <?php			elseif (is_category()) : /* If this is a category archive */ ?>
    <?php                       if ($udesign_options['show_archive_for_string'] == 'yes') : ?>
                                    <h1 class="pagetitle"><?php single_cat_title("", true); ?></h1>
    <?php                       else : ?>
    			    <h1 class="pagetitle"><?php printf( __('Archive for the ‘%s’ Category', 'udesign' ), single_cat_title("", false) ); ?></h1>
    <?php                       endif; ?>
    <?php			elseif (is_search()) : /* If this is a search results page */ ?>
    			    <h1 class="pagetitle"><?php printf( __('Search Results for ‘<em>%s</em>’', 'udesign' ), get_search_query() ); ?></h1>
    <?php			elseif (is_404()) : /* If this is a 404 page */ ?>
    			    <h1 class="pagetitle"><?php esc_html_e('Page Not Found (Error 404)', 'udesign'); ?></h1>
    <?php			elseif( is_tag() ) : /* If this is a tag archive */ ?>
    			    <h1 class="pagetitle"><?php printf( __('Posts Tagged ‘%s’', 'udesign' ), single_tag_title("", false) ); ?></h1>
    <?php			elseif (is_day()) : /* If this is a daily archive */ ?>
    			    <h1 class="pagetitle"><?php printf( __('Archive for %s', 'udesign' ), get_the_date() ); ?></h1>
    <?php			elseif (is_month()) : /* If this is a monthly archive */ ?>
    			    <h1 class="pagetitle"><?php printf( __('Archive for %s', 'udesign' ), get_the_time('F Y') ); ?></h1>
    <?php			elseif (is_year()) : /* If this is a yearly archive */ ?>
    			    <h1 class="pagetitle"><?php printf( __('Archive for %s', 'udesign' ), get_the_time('Y') ); ?></h1>
    <?php			elseif (is_author()) : /* If this is an author archive */ ?>
    			    <h1 class="pagetitle"><?php esc_html_e('Author Archive', 'udesign'); ?></h1>
    <?php			elseif (isset($_GET['paged']) && !empty($_GET['paged'])) : /* If this is a paged archive */ ?>
    			    <h1 class="pagetitle"><?php esc_html_e('Blog Archives', 'udesign'); ?></h1>
    <?php			else : // the case when a Title is NOT present the height should be maintained ?>
    			    <div class="no-title-present"></div>
    <?php			endif; ?>
    		    </div>

    Where do add the check to be able to set the Events Page Title? I don't think I can use the tribe() functions because the variables for tribe are not set in an order where they can be parsed? Am I thinking about this incorrectly?

  11. Kassander
    Member
    Posted 2 years ago #

    Same problem here. The Events Calendar doesn't seem to like U-Design. ;)

    Tried to get the code into the above mentioned header.php but it doesn't work.

  12. jonahcoyote
    Member
    Posted 2 years ago #

    Hi all, you could do something like this:

    [89 lines of code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

  13. britishholidaysdirect
    Member
    Posted 2 years ago #

    Hi, I love the plug in and managed to edit a lot of it without needing help, but there is one thing I am stumped on:
    on the main list page, I need the default "Upcoming Events" title to not show as I am using the plug in for Special Offers (on a accommodation website), so wanted to rename everything with the term "Event" to "Offer" - I used the above thread to add my own title but the default one is still showing - is there an easy way to remove it?
    You can see what I mean on my site here:
    http://britishholidaysdirect.com/special-offers/

    PS I am not all that great with coding, slightly better than a novice so any answers - please make it easy for a newbie to understand!!!

  14. bolide
    Member
    Posted 2 years ago #

    I have searched the code for "Upcoming Events" and can't find it. I'd love to know where it lives!

    Nick Froome

  15. Bradley Allen
    Member
    Posted 2 years ago #

    Hi britishholidaysdirect,
    I was able to change the page title for the main list view by editing line 637 in the-events-calendar.class.php which is located in the /lib directory.

  16. britishholidaysdirect
    Member
    Posted 2 years ago #

    Bradley, you are an absolute diamond, thank you!!!!!!

  17. grsblog4
    Member
    Posted 2 years ago #

    Bradley Allen or British Holiday Direct - I am a true beginner at code editing, so I apologize for my lack of knowledge! Could you explain to me exactly how you changed line 637 in the the-events-calendar.class.php file so the header would display "upcoming events" instead of pulling the title of your next event and placing that in the header?

    Thanks!

  18. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 2 years ago #

    Nice work, Bradley! Thanks for the assist on that man, glad to hear you were able to get britishholidaysdirect where they need to be.

    GRSblog4: have you popped open the-events-calendar.class.php in a text editor of your choosing yet?

  19. grsblog4
    Member
    Posted 2 years ago #

    I figured it out. I had to edit my code in my theme, no in the plugin. My theme was over-riding all the changes I was making to the plugin directly.

    Thank you!

  20. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 2 years ago #

    Great! Thanks for confirming as much here, grsblog4. We appreciate it as well as your use of the plugin. Looks like we're all set with this thread but if you need anything else in the future please let us know, and we'll do our best to assist.

  21. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 2 years ago #

    Thanks again, everyone. Closing this out.

  22. bocan
    Member
    Posted 1 year ago #

    Did anyone ever figure out how to fix this on the U-Design theme?

    I'd like to get the Pro version but I couldn't justify that until this design bug is fixed without having to hack my theme.

  23. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Do you find this still happens on 2.0.9, bocan? If you follow Bradley's steps, you shouldn't have to hack the theme - it's just a file within the plugin itself. Let me know if I'm misunderstood here though.

  24. bocan
    Member
    Posted 1 year ago #

    I tried Bradley's change but it doesn't seem to do anything when the U-Design theme is activated. grsblog4 seems to have found the solution but didn't give details.

  25. grsblog4
    Member
    Posted 1 year ago #

    Bocan - My fix might not be what you are looking for. WIth the code I edited, the top of every page reads "Green Ribbon Schools" in the header banner. It isn't the ideal situation, but it is enough to get by until I find a better fix.

    I don't know if this will help you at all, but I added this code to the header.php

    <?php } else { echo 'Green Ribbon Schools'; } ?>

  26. Sith Lord Goz
    Member
    Posted 1 year ago #

    I'm not sure if this is what you guys are looking for, but EC provides a filter to set the page title that you can override in your functions.php:


    function childtheme_get_events_title($content) {
    if (tribe_is_upcoming()) {
    $content = 'Some Upcoming Title';
    }
    else if (tribe_is_month()) {
    $content = 'Some Calendar Title';
    };
    return $content;
    }
    add_filter('tribe_get_events_title', 'childtheme_get_events_title');

    This PAGE title is NOT the same thing as the HTML DOCUMENT title (i.e. the string in the <title> tag) - I'm still searching for a solution to the issue of the next Event populating the html title.

  27. ianphil
    Member
    Posted 1 year ago #

    Can anyone tell me exactly what to change on line 637 to what?

    Thanks,

    Ian

  28. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year ago #

    Thanks for the tips on this so far, guys. Hopefully this is adding value to others as they work on this for now. To address Ian's comment...you'll probably want to change this:

    public function maybeAddEventTitle($title, $sep = null){
    if(get_query_var('eventDisplay') == 'upcoming'){
    $new_title = apply_filters( 'tribe_upcoming_events_title', __("Upcoming Events", 'tribe-events-calendar'). ' '.$sep . ' ' . $title, $sep );

    That help?

  29. RyanSeyes
    Member
    Posted 1 year ago #

    I just noticed I also have this problem.

    roblagatta, I've found those three lines of code in the PHP file but I'm not sure what to change exactly. I know CSS and HTML but PHP is like a foreign language to me. Can someone help?

  30. zynov
    Member
    Posted 1 year ago #

    Same here.

    I have found it in this file but not sure what to change.

    HELP please!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic