Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #25740

    Hi,

    thanks for the great theme. I have a problem that the breadcrumb on portfolio pages don’t match the structure as I defined it.

    In Enfold settings I have set the slug for single portfolio items to projects. but I get a breadcrumb that contains categories.

    For the page http://www.vizspecialeffects.nl/projects/dove-men-care/

    the breadcrumb is: Home / special-effects / physical effects / liquids / Dove MEN + CARE

    but should be: Home / projects / Dove MEN + CARE

    Any idea how I can get the right breadcrumb?

    Thanks, chears Rob

    #128037

    Kriesi uses a session to store the portfolio page (which then links to the portfolio single entry). In your case the portfolio page is: http://www.vizspecialeffects.nl/special-effects/projects/ and wehen I click on “Dove..” the breacrumb shows “Home / special-effects / commercial projects / Dove MEN + CARE” which is imo correct. If you want to display the portfolio slug instead open up wp-contentthemesenfoldincludeshelper-template-logic.php and replace

    if(get_post_type() === "portfolio")
    {
    $page = "";
    $front = avia_get_option('frontpage');

    if(session_id() && !empty($_SESSION['avia_portfolio']))
    {
    $page = $_SESSION['avia_portfolio'];
    }

    if(!$page || $page == $front)
    {
    $args = array( 'post_type' => 'page', 'meta_query' => array(
    array( 'key' => '_avia_builder_shortcode_tree', 'value' => 'av_portfolio', 'compare' => 'LIKE' ) ) );

    $query = new WP_Query( $args );

    if($query->post_count == 1)
    {
    $page = $query->posts[0]->ID;
    }
    else if($query->post_count > 1)
    {
    foreach($query->posts as $entry)
    {
    if ($front != $entry->ID)
    {
    $page = $entry->ID;
    break;
    }
    }
    }
    }

    if($page)
    {
    if($page == $front)
    {
    $newtrail[0] = $trail[0];
    $newtrail['trail_end'] = $trail['trail_end'];
    $trail = $newtrail;
    }
    else
    {
    $newtrail = avia_breadcrumbs_get_parents( $page, '' );
    array_unshift($newtrail, $trail[0]);
    $newtrail['trail_end'] = $trail['trail_end'];
    $trail = $newtrail;
    }

    }
    }

    with

    if(get_post_type() === "portfolio")
    {
    $slugRule = avia_get_option('portfolio-slug');

    if($slugRule)
    {
    $newtrail[0] = $trail[0];
    $newtrail[1] = '<a href="http://mywebsite.com" title="Projects">'.$slugRule.'</a>';
    $newtrail['trail_end'] = $trail['trail_end'];
    $trail = $newtrail;

    }
    }

    and replace “http://mywebsite.com” with the url you want to use for the “Projects” breadcrumb item…

    #128038

    Hi Dude,

    I have changed this and it works fine.

    Chears Rob

    #128039

    Hey!

    Great :)

    Best regards,

    Peter

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

The topic ‘breadcrumbs portfolio items (enfold)’ is closed to new replies.