Agency – breadcrumbs issue

Community Forums Forums General Discussion Agency – breadcrumbs issue

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  Bill Murray 1 year, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8090

    ckweb
    Participant

    When I first set up Agency I tried to switch my homepage to static and assign my posts to my blog page under the reading settings, which I’ve done with many other sites.  That didn’t work, and I think I now understand that the Agency child theme doesn’t use a static page as a homepage, but the latest blog posts are also not shown on the homepage.  Instead, the homepage is populated with widgets, and the blog posts can be displayed on any page or even multiple pages by using the ‘blog’ template.

    So far I have gotten all that working, with my homepage looking good and my blog posts showing on my blog page, http://www.example.com/blog/, but one issue is still throwing me for a loop.  The blog posts themselves aren’t nested under the blog page, WordPress still thinks the blog page is the site root, so my blog page is not included in the url path or the breadcrumb path for a blog post.  The url path I can deal with by making a custom permalink structure which includes /blog/ in the url structure.   However, the breadcrumbs function doesn’t seem to recognize this, and I can’t see how to insert a breadcrumb manually in the path.  Both the Genesis breadcrumbs and the Yoast breadcrumbs just seem to be looking for the parent hierarchy to generate the breadcrumbs, so when I view my new blog post, the breadcrumbs don’t include they blog homepage, there is only the home link.

    It seems very basic that if you are reading a blog post you’d want to have a breadcrumb link back to the main blog page as well as the home page – so how can I get this?  Is there a way to manually stuff a breadcrumb into the path for all blog posts?  Or is there a way to set my blog page as the parent of all blog posts without breaking the Agency homepage template?

    I have mainly been developing this on a local machine, but since I know it helps to have a link to a live site, for the moment I have a test site up here:  http://ergonavar.com/dev/peak/

     

    #8094

    Bill Murray
    Participant
    Post count: 572

    Without looking in detail at your site, is your blog page a WP page that uses the blog template where you define in Genesis settings which categories you want to include in your blog page template?  The breadcrumb you want to include is the page, and I don’t think Genesis includes that by default.  For that reason, I often just create a category of “Blog” and make my menu a link to that category archive.  If you don’t want to do that, you could try these things, all of which are untested:

    1) Explore the Breadcrumb NavXT or Genesis Simple Breadcrumbs plugins; I’m not sure either will get you what you want, but when breadcrumb issues have come up before, these plugins get mentioned  because they provide more power/flexibility

    2) See what this code does in your child theme’s functions.php:

    add_filter('genesis_single_crumb', 'test_add_blog_to_breadcrumb');
    add_filter('genesis_archive_crumb', '
    test_add_blog_to_breadcrumb');
    function test_add_blog_to_breadcrumb($crumb) {
    return '<a href="'.get_permalink(get_option( 'page_for_posts' )).'">'.get_the_title(get_option( 'page_for_posts' )).'</a> > '.$crumb;
    }

    I haven’t tested that, so it might  not get you what you want.  Post back with the results and I will try to tweak it.


    Web: http://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

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

You must be logged in to reply to this topic.