Skip to:
Content
Pages
Categories
Search
Top
Bottom

Getting breadcrumbs to play nice with rest of the blog


  • kristinachilds
    Participant

    @kristinachilds

    We are adding forums to an existing site rather than having a site that is 100% forums. I already have a breadcrumb set up for the main site but the forums don’t show up in them. Since the bbPress breadcrumb functions are significantly more complex than the simple breadcrumbs I currently use I decided to use bbPress’ crumbs in place of the main one. I have successfully modified the function to include category and single page data in the crumbs (without having “forums” as the base) but the blog root disappears. Help? Here’s what I added to ** Current Text **

    // Category Page
    if (is_category() || is_single()) {
        the_category(' » ');
        if (is_single()) {
            echo " » ";
            the_title();
        }
    

    That omitted the blog root from the crumbs, so I tried this, which didn’t work either.

    if (is_category() || is_single()) {
        $pre_current_text[] = '<a href="' . trailingslashit( home_url() ) . '">Front Row</a>' . the_category(' &raquo; ');
        if (is_single()) {
            echo " &raquo; ";
            the_title();
        }
    

    I’m not really sure what I’m doing here. I’m no function whiz.

Viewing 1 replies (of 1 total)

  • kristinachilds
    Participant

    @kristinachilds

    I have tried a new approach – using conditional statements in header.php (where my breadcrumbs live) to serve different content for different pages. This won’t let me post PHP code (really??) so here’s a pastebin link http://pastebin.com/PYmw4eL6

    It works! a little clunky but it gets the job done

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar