Tagged: x
-
AuthorPosts
-
October 2, 2016 at 10:44 am #1199377
armintzParticipantis it possible to change the title in the breadcrumbs area based on a post’s category?
for example, my main blog page title is “blog”, which is fine. But I have specific blog posts that are marked with a category called “nintendo to yacht”… on these particular posts (marked with the category “nintendo to yacht”) can i have the title area for these posts say “nintendo to yacht” instead of “blog”?
screenshot attached.
live post: http://websitehell.com/nintendo-to-yacht-update-1/
i’m using the Renew stack. thank you
October 2, 2016 at 11:21 am #1199407
RupokMemberHi there,
Thanks for wriitng in! It would be possible with Child Theme
You need to edit the file /framework/views/renew/_landmark-header.php.
For your convenience here goes the code you need to place there :
<?php // ============================================================================= // VIEWS/RENEW/_LANDMARK-HEADER.PHP // ----------------------------------------------------------------------------- // Handles content output of large headers for key pages such as the blog or // search results. // ============================================================================= $disable_page_title = get_post_meta( get_the_ID(), '_x_entry_disable_page_title', true ); $breadcrumbs = x_get_option( 'x_breadcrumb_display' ); ?> <?php if ( ! x_is_blank( 1 ) && ! x_is_blank( 2 ) && ! x_is_blank( 4 ) && ! x_is_blank( 5 ) ) : ?> <?php if ( is_page() && $disable_page_title == 'on' ) : ?> <?php else : ?> <header class="x-header-landmark"> <div class="x-container max width"> <div class="x-landmark-breadcrumbs-wrap"> <div class="x-landmark"> <?php if ( x_is_shop() || x_is_product() ) : ?> <h1 class="h-landmark"><span><?php echo x_get_option( 'x_renew_shop_title' ); ?></span></h1> <?php elseif ( x_is_bbpress() ) : ?> <h1 class="h-landmark"><span><?php echo get_the_title(); ?></span></h1> <?php elseif ( x_is_buddypress() ) : ?> <?php if ( x_buddypress_is_component_with_landmark_header() ) : ?> <h1 class="h-landmark"><span><?php echo x_buddypress_get_the_title(); ?></span></h1> <?php endif; ?> <?php elseif ( is_page() ) : ?> <h1 class="h-landmark entry-title"><span><?php the_title(); ?></span></h1> <?php elseif ( is_home() || is_single() ) : ?> <?php if ( x_is_portfolio_item() ) : ?> <h1 class="h-landmark"><span><?php echo x_get_parent_portfolio_title(); ?></span></h1> <?php else : ?> <h1 class="h-landmark"><span> <?php foreach((get_the_category()) as $category) { echo $category->cat_name . ' '; } ?> </span></h1> <?php endif; ?> <?php elseif ( is_search() ) : ?> <h1 class="h-landmark"><span><?php _e( 'Search Results', '__x__' ); ?></span></h1> <?php elseif ( is_category() || x_is_portfolio_category() || x_is_product_category() ) : ?> <?php $meta = x_get_taxonomy_meta(); $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Category Archive', '__x__' ); ?> <h1 class="h-landmark"><span><?php echo $title; ?></span></h1> <?php elseif ( is_tag() || x_is_portfolio_tag() || x_is_product_tag() ) : ?> <?php $meta = x_get_taxonomy_meta(); $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Tag Archive', '__x__' ); ?> <h1 class="h-landmark"><span><?php echo $title ?></span></h1> <?php elseif ( is_404() ) : ?> <h1 class="h-landmark"><span><?php _e( 'Oops!', '__x__' ); ?></span></h1> <?php elseif ( is_year() ) : ?> <h1 class="h-landmark"><span><?php _e( 'Post Archive by Year', '__x__' ); ?></span></h1> <?php elseif ( is_month() ) : ?> <h1 class="h-landmark"><span><?php _e( 'Post Archive by Month', '__x__' ); ?></span></h1> <?php elseif ( is_day() ) : ?> <h1 class="h-landmark"><span><?php _e( 'Post Archive by Day', '__x__' ); ?></span></h1> <?php elseif ( x_is_portfolio() ) : ?> <h1 class="h-landmark"><span><?php the_title(); ?></span></h1> <?php endif; ?> </div> <?php if ( $breadcrumbs == '1' ) : ?> <?php if ( ! is_front_page() && ! x_is_portfolio() ) : ?> <div class="x-breadcrumbs-wrap"> <?php x_breadcrumbs(); ?> </div> <?php endif; ?> <?php endif; ?> <?php if ( x_is_portfolio() ) : ?> <div class="x-breadcrumbs-wrap"> <?php x_portfolio_filters(); ?> </div> <?php endif; ?> </div> </div> </header> <?php endif; ?> <?php endif; ?>Hope this helps.
October 2, 2016 at 11:37 am #1199420
armintzParticipantthanks for your fast response. i do have a child theme activated, but it looks like it only includes 2 files: style.css and functions.php
would i need to create a new file from scratch for ‘_landmark-header.php’ and upload to my child directory?
October 2, 2016 at 12:09 pm #1199450
RupokMemberHi there,
Thanks for writing back. If you are using the latest version of Child Theme then you should have the folders there and you need to create the file only. However you can create the directory and add the file there. Hopefullt it will work fine as I have tested on my end.
Cheers!
October 2, 2016 at 12:13 pm #1199456
armintzParticipantoh okay, yeah, in filezilla i see the child directory > framework > views > renew (attached screenshot).
i created the “_landmark-header.php” file in notepad, using your code in post #1199407, and then dropped it in the ‘renew’ directory…
where exactly in the code do I change the title?
October 2, 2016 at 12:27 pm #1199469
armintzParticipantoh wait, i just realized the title is already changed in the php file you provided.. you didn’t need to do the work for me, but i really appreciate it. thank you!
October 2, 2016 at 1:01 pm #1199503
RupokMemberHi there,
Yes I did it already for you. Glad that it helped. You will find the unchanged file in parent theme on the same directory.
Cheers!
October 9, 2016 at 8:39 pm #1209303
armintzParticipantI didn’t notice at first, but this change actually altered the page title in the breadcrumb area for all of my posts, not just the posts in the specific category I wanted to alter.
For example, posts that are not marked with the “Nintendo to Yacht” category should simply say “blog” in the page title area (as they normally would)… but instead, after adding the ‘_landmark-header.php’ file above, they now list the categories in the breadcrumb area – see attached screenshot for example, or this live post here: http://websitehell.com/15-ways-ensure-web-developer-stops-returning-phone-calls/
Again, I only want posts that are marked with the “Nintendo to Yacht” category to have the page title in the breadcrumb area changed. Thanks
October 10, 2016 at 12:40 am #1209405
RupokMemberHi there,
Thanks for writing back. Unfortunately this customization would be out of our support scope as it will need some complex coding. As you already know the right file, you can modify as your needs.
Thanks for understanding.
October 17, 2016 at 10:22 am #1219464
armintzParticipantOkay. I’ve sent a message to your customizations department. Thanks
October 17, 2016 at 10:39 am #1219477
RahulModeratorGood to hear that.
Just describe everything well and you’ll get proper help from them.
Thank you.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1199377 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
