Home › Forums › Calendar Products › Events Calendar PRO › Events Page title is Blog Archives
- This topic has 6 replies, 2 voices, and was last updated 10 years, 3 months ago by
Hunter.
-
AuthorPosts
-
January 8, 2016 at 8:29 am #1052614
Birgit Bauer
ParticipantHello, my events page displays Blog Archives as the title:
I found a discussion about that and there is some code provided .. I just want to be sure I am using the code correctly.
This is the code:
if( tribe_is_month() || tribe_is_week() || tribe_is_day() || tribe_is_map() ) { $title = "<h1>Calendar</h1>"; } elseif( tribe_is_past() || tribe_is_upcoming() ) { $title = "<h1>Calendar</h1>"; } else { }And here I inserted it. Is this ok?
<?php if (is_single()): $options = thrive_get_options_for_post(get_the_ID()); $post_format = get_post_format(); $post_format_options = _thrive_get_post_format_fields($post_format, get_the_ID()); if (isset($options['meta_author_name']) && $options['meta_author_name'] == 1) { $author_info = _thrive_get_author_info(get_the_author_meta('ID')); } $thrive_meta_postformat_video_type = get_post_meta(get_the_ID(), '_thrive_meta_postformat_video_type', true); $vimeo_embed_class=''; if ($thrive_meta_postformat_video_type == "vimeo") { $vimeo_embed_class = "v-cep"; } ?> if( tribe_is_month() || tribe_is_week() || tribe_is_day() || tribe_is_map() ) { $title = "<h1>Calendar</h1>"; } elseif( tribe_is_past() || tribe_is_upcoming() ) { $title = "<h1>Calendar</h1>"; } else { } <?php if ($post_format == "quote"): ?> <div class="quo"> <h1><?php echo $post_format_options['quote_text']; ?></h1> <?php if (!empty($post_format_options['quote_author'])): ?> <p> <?php echo $post_format_options['quote_author']; ?></p> <?php endif; ?> </div> <?php elseif ($post_format == "video"): ?> <?php $wistiaVideoCode = (strpos($post_format_options['video_code'], "wistia") !== false) ? ' wistia-video-container' : ''; ?> <div class="vt <?php echo $vimeo_embed_class;echo $wistiaVideoCode;?>"> <div class="vt-t"> <?php if ($options['show_post_title'] != 0): ?> <h1><?php the_title(); ?></h1> <?php endif; ?> <?php if (!empty($post_format_options['video_code'])) : ?> <div class="pvb"> <a href=""></a> </div> <?php endif ?> </div> <?php if (!empty($post_format_options['video_code'])) : ?> <div class="vt-v"> <div class="vt-vi"> <?php echo $post_format_options['video_code']; ?> </div> </div> <?php endif ?> </div> <?php else: ?> <?php if ($options['show_post_title'] != 0): ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php endif; ?> <?php endif; ?> <?php if (get_post_meta(get_the_ID(), "_thrive_meta_show_content_title", true) == 1): ?> <?php echo do_shortcode(get_post_meta(get_the_ID(), "_thrive_meta_content_title", true)); ?> <?php endif; ?> <?php if ($options['meta_author_name'] == 1 || $options['meta_post_category'] == 1): ?> <p> <?php if ($options['meta_author_name'] == 1): ?> <?php _e("By", 'thrive'); ?> <a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>"><?php echo $author_info['display_name']; ?></a> <?php endif; ?> <?php if ($options['meta_author_name'] == 1 && $options['meta_post_category'] == 1): ?> <span class="sep">|</span> <?php endif; ?> <?php if ($options['meta_post_category'] == 1): $categories = get_the_category(); if ($categories && count($categories) > 0): ?> <a href="<?php echo get_category_link($categories[0]->term_id); ?>"><?php echo $categories[0]->cat_name; ?></a> <?php endif; ?> <?php endif; ?> </p> <?php endif; ?> <?php endif; ?> <?php if (is_page()): $options = thrive_get_options_for_post(get_the_ID()); ?> <?php if ($options['show_post_title'] != 0): ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php endif; ?> <?php if (get_post_meta(get_the_ID(), "_thrive_meta_show_content_title", true) == 1): ?> <?php echo do_shortcode(get_post_meta(get_the_ID(), "_thrive_meta_content_title", true)); ?> <?php endif; ?> <?php endif; ?> <?php if (is_author()): ?> <h1 class="entry-title"><?php _e("All Posts by", 'thrive'); ?> <?php echo get_the_author(); ?></h1> <?php endif; ?> <?php $is_shop_page = function_exists('is_shop') ? is_shop(): false; ?> <?php if (is_archive() && !is_author() && !is_category() && !is_tag() && !is_search() && !$is_shop_page): ?> <h1 class="entry-title"> <?php if (is_day()) : ?> <?php printf(__('Daily Archives: %s', 'thrive'), '' . get_the_date() . ''); ?> <?php elseif (is_month()) : ?> <?php printf(__('Monthly Archives: %s', 'thrive'), '' . get_the_date(_x('F Y', 'monthly archives date format', 'thrive')) . ''); ?> <?php elseif (is_year()) : ?> <?php printf(__('Yearly Archives: %s', 'thrive'), '' . get_the_date(_x('Y', 'yearly archives date format', 'thrive')) . ''); ?> <?php else : ?> <?php _e('Blog Archives', 'thrive'); ?> <?php endif; ?> </h1> <?php endif; ?> <?php if (is_category()): ?> <h1 class="entry-title"><?php printf(__('Category Archives for "%s"', 'thrive'), '' . single_cat_title('', false) . ''); ?></h1> <?php endif; ?> <?php if (is_search()): ?> <h1 class="entry-title"><?php printf(__('Search Results for: %s', 'thrive'), '' . get_search_query() . ''); ?></h1> <?php endif; ?> <?php if (is_tag()): ?> <h1 class="entry-title"><?php printf(__('Tag Archives for " %s " ', 'thrive'), '' . single_tag_title('', false) . ''); ?></h1> <?php endif; ?>January 8, 2016 at 8:36 am #1052622Birgit Bauer
ParticipantWhat may be important … I am using Photo view, list view and month view.
-
This reply was modified 10 years, 3 months ago by
Birgit Bauer.
January 8, 2016 at 8:11 pm #1052928Hunter
ModeratorHey Birgit,
Welcome back to the forums! I believe the thread you refer to in your original post is found here, correct?
I did some quick testing on my local environment and found this gist on GitHub to produce the desired titles in combination with WordPress SEO (Yoast) rather than the snippet you originally shared. Try inserting the code the from the gist provided into the bottom of your theme’s functions.php file.
Please note that titles are affected by many factors, so your best bet is trial and error. Let me know if this helps!
January 9, 2016 at 9:09 am #1053188Birgit Bauer
ParticipantHello Hunter,
thank you for your answer.
Yes, I got the code from that post.
And yes, I would try it out but I wanted to know, if I inserted the code correctly.So the first code is the part I inserted and the second code displayed above is the code of my website where I inserted the first code .. but I am not sure if it’s done correctly … And I dont want to crash the website … since it is live.
So I just wanted to know if the way I inserted the code into my code is right.
The inserted code starts at line 16.January 9, 2016 at 11:11 am #1053228Hunter
ModeratorHello Birgit,
It’s hard for me to guarantee that is indeed where the code belongs. The most likely place you’ll need to insert it is at the bottom of your theme’s functions.php file. And before saving any changes, be sure to backup your database!
I would advise against working on a live server unless you have direct FTP access, preferably through a text editor so you can simply undo the saved changes.
I apologize I’m unable to provide more detailed assistance as these types of customizations are outside our scope of support. You may want to try and contact the author of your theme. Good luck and enjoy the remainder of your weekend!
January 21, 2016 at 9:40 pm #1060235Birgit Bauer
ParticipantHello Hunter,
sorry for my late reply. Finally I just translated the strings that ‘print’ the Archives title and it worked well:
<?php if (is_archive() && !is_author() && !is_category() && !is_tag() && !is_search() && !$is_shop_page): ?> <h1 class="entry-title"> <?php if (is_day()) : ?> <?php printf(__('Daily Archives: %s', 'thrive'), '' . get_the_date() . ''); ?> <?php elseif (is_month()) : ?> <?php printf(__('Monthly Archives: %s', 'thrive'), '' . get_the_date(_x('F Y', 'monthly archives date format', 'thrive')) . ''); ?> <?php elseif (is_year()) : ?> <?php printf(__('Yearly Archives: %s', 'thrive'), '' . get_the_date(_x('Y', 'yearly archives date format', 'thrive')) . ''); ?> <?php else : ?> <?php _e('Blog Archives', 'thrive'); ?> <?php endif; ?> </h1> <?php endif; ?>So this case can be closed.
January 22, 2016 at 10:42 am #1060630Hunter
ModeratorGlad to hear you’ve got it resolved! Thanks for letting me know. I’ll close this thread, but please feel free to open a new one should you have any more questions. Have a great weekend!
-
This reply was modified 10 years, 3 months ago by
-
AuthorPosts
- The topic ‘Events Page title is Blog Archives’ is closed to new replies.
