Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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

    #121145

    Hi,

    Just add this on your custom.css

    .trail-end {
    display: none !important;
    }

    Regards,

    Ismael

    #121146

    Hey Ismael,

    Perhaps this photo will help. I’m trying to change the ‘header’ on the left of the breadcrumb section.

    #121147

    Open 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) );

    #121148

    Is 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(); ?>

    #121149

    I 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! :)

    #121150

    Hi,

    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

    #121151

    Yes, 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! :)

    #121152

    In 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;
    }

    #121153

    You guys are legend. Thank you!!! :)

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘Modifying Breadcrumb Header’ is closed to new replies.