Skip to:
Content
Pages
Categories
Search
Top
Bottom

[SOLVED] Breadcrumb custom display in the theme


  • j0k
    Participant

    @j0k

    Hi,

    I am using bbPress for a WordPress website. It is working great, but I have few problems to customize it…

    In the WP theme I made, I have a breadcrumb (created in functions.php), and in the forums pages, I also have the bbPress breadcrumb that is displayed. Because mine doesn’t work in the forum pages (because I don’t succeed in displaying the custom posts), I would like to do something like this in my theme files:
    - If the Forum Page is displayed –> display my_breadcrumb(); (because it is a normal post)
    - If the other forum pages are displayed –> display bbp_breadcrumb(); (because they are custom posts)

    But for this (stop me if I am wrong) I think I have to edit the bbp_template_before_forums_loop in the bbp-theme-compat folder, to remove manually the bbp_breadcrumb and to display it in my theme, but I can’t find in which file is called bbp_template_before_forums_loop.

    Thanks by advance for your help, and don’t hesitate to ask if you need more details!

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

  • j0k
    Participant

    @j0k

    OK, I succeeded in doing the first thing.

    I checked in the database and found the custom post types in the wp_posts table:
    `
    if (!is_post_type(‘forum’) || !is_post_type(‘post’) || !is_post_type(‘topic’) || !is_post_type(‘reply’)){
    if (function_exists(‘my_breadcrumb’)) my_breadcrumb();
    }
    `

    The problem now is that I have to do it for all the children pages of these custom post types (forum, post, topic and reply), but I can’t find how to do it. I will try something with the get_page_children() function but I am not sure that it will work with custom posts…


    j0k
    Participant

    @j0k

    Oh damn, here is the good syntax:

    `
    if (!is_post_type(‘forum’) && !is_post_type(‘post’) && !is_post_type(‘topic’) && !is_post_type(‘reply’)){
    if (function_exists(‘my_breadcrumb’)) my_breadcrumb();
    }
    `

    Now it works, I just have to find the “else” part with the bbPress breadcrumb to display in the theme and my problem will be resolved.

    [sorry for the multi-posts, but I can't edit my last reply]

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

You must be logged in to reply to this topic.