Tagged: breadcrumb, header, modify
-
AuthorPosts
-
May 24, 2013 at 4:56 pm #23793
Hey there,
I am wondering if I can make a slight change to the breadcrumb header on my portfolio page.
http://godsfingerprints.net.s168021.gridserver.com/?portfolio=come-near-to-god
Right now, the portfolio title is displaying on the left of the ‘breadcrumb header’. I would like to display the name of the category instead. For example, display ‘Desktop Wallpapers’ would make much more sense from a usability point of view on this page (instead of displaying the portfolio title twice).
Please let me know.. thanks so much!
Jason
May 25, 2013 at 2:22 am #121145Hi,
Just add this on your custom.css
.trail-end {
display: none !important;
}Regards,
Ismael
May 25, 2013 at 3:33 am #121146Hey Ismael,
Perhaps this photo will help. I’m trying to change the ‘header’ on the left of the breadcrumb section.
May 25, 2013 at 8:59 am #121147Open up wp-contentthemesenfoldsingle-portfolio.php and replace
if( get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title();
with
$terms = get_the_terms( get_the_ID(), 'portfolio_entries' );
foreach ($terms as $term) {
$title = $term->name;
break;
}
if( get_post_meta(get_the_ID(), 'header', true) != 'no') echo avia_title( array('title' => $title) );May 25, 2013 at 5:08 pm #121148Is there any other step I need to take in order for it to display “Desktop Wallpapers” (the name of the portfolio category) ?
I made the change you suggested and nothing seemed to change.
http://godsfingerprints.net.s168021.gridserver.com/?portfolio=come-near-to-god
Code below:
<?php
global $avia_config;
/*
* get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
*/
get_header();
$terms = get_the_terms( get_the_ID(), ‘portfolio_entries’ );
foreach ($terms as $term) {
$title = $term->name;
break;
}
if( get_post_meta(get_the_ID(), ‘header’, true) != ‘no’) echo avia_title( array(‘title’ => $title) );
?>
<div class=’container_wrap main_color <?php avia_layout_class( ‘main’ ); ?>’>
<div class=’container’>
<div class=’template-page template-portfolio content <?php avia_layout_class( ‘content’ ); ?> units’>
<?php
/* Run the loop to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-page.php and that will be used instead.
*/
$avia_config = avia_layout_class( ‘main’ , false) == ‘entry_without_sidebar’ ? ” : ‘entry_with_sidebar’;
get_template_part( ‘includes/loop’, ‘portfolio-single’ );
?>
<!–end content–>
</div>
<?php
//get the sidebar
$avia_config = ‘page’;
get_sidebar();
?>
</div><!–end container–>
<?php get_footer(); ?>
May 25, 2013 at 5:15 pm #121149I would also be willing to do this manually in some way. For example, entering in the title “Desktop Wallpapers” in the excerpt of each entry.. or something similar.
I just want the category to be displayed at the top of each portfolio entry.
Thanks again for all your help. Sincerely appreciated! :)
May 26, 2013 at 2:36 am #121150Hi,
Is Desktop Wallpaper a category for your portfolio entries? Please make it a category then do Dude’s code above. This will only work if you are not using the Advance Layout Editor for your portfolio items.
Regards,
Ismael
May 26, 2013 at 7:17 am #121151Yes, Desktop Wallpaper is a category for that portfolio entry. Each portfolio item only has one category.
However, I am using the advance layout editor. I find it quite helpful.. is there no way to have this work while using that feature for my layouts? Is there any work-around? Or do I need to code each portfolio layout from scratch for this to work?
Thanks again for all your help! :)
May 26, 2013 at 7:48 am #121152In this case revert the changes I posted above and insert following code at the very bottom of functions.php. This code will also work with advanced layouts:
add_filter('avf_title_args', 'change_prtf_title', 10, 2);
function change_prtf_title($args, $id){
if(is_single() && get_post_type() == 'portfolio')
{
$terms = get_the_terms( $id, 'portfolio_entries' );
foreach ($terms as $term) {
$args['title'] = $term->name;
break;
}
}
return $args;
}May 26, 2013 at 8:25 pm #121153You guys are legend. Thank you!!! :)
-
AuthorPosts
- The topic ‘Modifying Breadcrumb Header’ is closed to new replies.