• Resolved elrezzo

    (@elrezzo)


    For some reason I can’t seem to change the page title of the events month view page, at the moment I’m getting ‘Not Found’ for the page title. I’ve got a function to display the title so I know that the reason I’m getting that page title is cause it’s hitting the is_404 conditional. I’ve tried using a few conditionals like tribe_is_month and tribe_is_month && !is_tax, but nothing seems to be working. Got any ideas on how to resolve this?

    I’m using version 3.8.1 of The Events Calendar.

    https://wordpress.org/plugins/the-events-calendar/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor leahkoerper

    (@leahkoerper)

    Hi elrezzo,

    Thanks for getting in touch. Are you wanting to change the heading on the Month View page, e.g. to something other than ‘Events for October 2014’? We have a tutorial for doing that.

    If you’d like to change the page title in the browser, you might check out the snippet Brook shared in this thread.

    I hope that will help!

    Best,
    Leah

    Thread Starter elrezzo

    (@elrezzo)

    At the moment I’m not getting the default title for the Month View, I’m getting the title ‘Not Found’.

    http://highway.bigrigmedia.com/events/

    I’ve tried modifying the function I’m using to display the title, but nothing has seemed to work.

    function modular_title() {
      global $post;
    
      if (is_home()) {
        if (get_option('page_for_posts', true)) {
          return get_the_title(get_option('page_for_posts', true));
        } else {
          return __('Latest Posts', 'modular');
        }
      } elseif (is_archive()) {
        $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
        if ($term) {
          return apply_filters('single_term_title', $term->name);
        } elseif (is_post_type_archive()) {
          return apply_filters('the_title', get_queried_object()->labels->name);
        } elseif (is_day()) {
          return sprintf(__('Daily Archives: %s', 'modular'), get_the_date());
        } elseif (is_month()) {
          return sprintf(__('Monthly Archives: %s', 'modular'), get_the_date('F Y'));
        } elseif (is_year()) {
          return sprintf(__('Yearly Archives: %s', 'modular'), get_the_date('Y'));
        } elseif (is_author()) {
          $author = get_queried_object();
          return sprintf(__('Author Archives: %s', 'modular'), apply_filters('the_author', is_object($author) ? $author->display_name : null));
        } elseif(is_category()) {
          $category = get_the_category();
    
          if((int)$category[0]->parent === 435){
            return get_cat_name($category[0]->parent);
          } else {
            return get_cat_name($category[0]->parent).' '.single_cat_title('', false);
          }
        } else {
          return single_cat_title('', false);
        }
      } elseif (is_search()) {
        return sprintf(__('Search Results for %s', 'modular'), get_search_query());
      } elseif (is_child($post->ID)) {
        return get_the_title($post->post_parent);
      } elseif (is_404()) {
        return __('Not Found', 'modular');
      } else {
        return get_the_title();
      }
    }
    Plugin Contributor leahkoerper

    (@leahkoerper)

    Hi elrezzo,

    If you are not getting the regular title for the views, the first thing to do would be to remove your customizations and make sure that’s not the cause. You’ll also want to test for a conflict with another plugin or theme. Once you resolve that issue, you’ll hopefully be able to use our tutorial to change the title.

    Best,
    Leah

    Plugin Contributor leahkoerper

    (@leahkoerper)

    It’s been a month since we last heard from you, so in accordance with our forum guidelines I’m marking this thread resolved. Thanks for your support!

    ~Leah

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Page Title’ is closed to new replies.