WordPress.org

Ready to get started?Download WordPress

Forums

Breadcrumb NavXT
Breadcrumb blog link in archives.php page (12 posts)

  1. Draakjuh
    Member
    Posted 2 years ago #

    I installed breadcrumb, and everything works perfect, except for one thing.
    If I got to the http://www.linkofwebsite.com/blog/2011/10 (archives.php page) the breadcrumb doesn't show the blog page.

    It shows only this at the moment: Home » 2011 » October

    I would like to change the breadcrumb to this: Home » blog » 2011 » October

    How can I change the breadcrumb plugin to fix this problem?

    http://wordpress.org/extend/plugins/breadcrumb-navxt/

  2. John Havlik
    Member
    Plugin Author

    Posted 2 years ago #

    Right now date archives are assumed to fall under the "page on front" rather than under the "page for posts". I need to verify that custom post types do not show up in the date archives before moving it over to the "page for posts" (e.g. blog) part of the hierarchy. Currently, there isn't a way around this, but for the next release either it will be changed or an option will be available.

  3. Draakjuh
    Member
    Posted 2 years ago #

    Thank you for the reply.

    I will wait for the update then. Thanks that you will try to fix this problem for the update.

  4. paulc123
    Member
    Posted 2 years ago #

    Hi Draakjuh

    I had the same problem so assumed this hadn't been done yet. Anyway a hack ...

    <?

    if (is_archive()){
    
    	if(is_year()){//in media archive custom post type browsing by year
    
    		echo '<a title="Go to Home." href="/">Home</a> > <a title="Go to Media Center." href="/media-center/">Media Center</a> > <a href="/media-center/media-archive/">Media Archive</a> > ';
    		echo get_the_date( 'Y' );
    
    	}else{//in monthly news archive
    		echo '<a title="Go to Home." href="/">Home</a> > <a title="Go to Media Center." href="/">Media Center</a> > ';
    		echo get_the_date( 'F' );
    	}
    }else{//not in archive -just use the breadcrumb
    
    	if(function_exists('bcn_display'))
    	{
    		bcn_display();
    	}
    }

    ?>

  5. John Havlik
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for bumping this, I had forgotten about it. I added a GitHub issue for it, and will be addressing it shortly (though it may not make 4.1.0, depending on when the translations are done).

  6. msrosyidi
    Member
    Posted 2 years ago #

    Thanks for fixing this problem.

  7. daledude
    Member
    Posted 2 years ago #

    Is this the same issue as using a blog.php template for your post page instead of assigning a posts page in Settings > Reading?

    Because the breadcrumb for my posts pages are:
    Home > [post title]

    When I want it to be

    Home > Our Community > News > [post title]

  8. John Havlik
    Member
    Plugin Author

    Posted 2 years ago #

    This is different from what you are talking about. Breadcrumb NavXT does not listen to theme/template based modifications to the site structure, if you want posts to be under the page structure of Home > Our Community > News (with News and Our Community being pages), you will need to set News as the page for posts and make sure it is a child of the page "Our Community". Or if News is a category, then the post must be a member of that category and Community would need to be the "Page for Posts" if you are going the static front page route.

  9. daledude
    Member
    Posted 2 years ago #

    The way WordPress does the posts page when assigned under Settings > Reading restricts how you can style it based on (I believe) what's in index.php, but I want/need to style the News page differently from other pages, so I use blog.php with PHP code to pull in posts:

    <?php
    $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query();
    $wp_query->query('posts_per_page=5'.'&paged='.$paged);
    while ($wp_query->have_posts()) : $wp_query->the_post();
    ?>

    If I assign News as the posts page under Settings > Reading, it completely ignores the fact that I assigned the blog.php template to it and instead uses what's in index.php. It WILL show the breadcrumb properly as Home > Our Community > News > [news post] then though. But as soon as I unasssign it from Settings > Reading, it goes to the styling I actually WANT, but the breadcrumb becomes Home > [news post]. I guess this is a problem with WordPress, not BNXT.

  10. John Havlik
    Member
    Plugin Author

    Posted 2 years ago #

    You may want to play around with your template file names a little. See http://codex.wordpress.org/Theme_Development and http://codex.wordpress.org/Template_Hierarchy

    It looks like you really want blog.php to be home.php when using a static front page (I know, it's not really intuitive). Then you'd just use the normal loop constructs rather than a custom query.

  11. daledude
    Member
    Posted 2 years ago #

    Hm. That may be it. I have those same two links bookmarked in Pinboard (and Delicious before that) and I swear they used blog.php to do what apparently home.php does now... but it's been so long since I've had to do this. Thanks!

  12. John Havlik
    Member
    Plugin Author

    Posted 2 years ago #

    I can't blame you for that one, I had thought blog.php was in there somewhere until I looked it up again.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic