WordPress.org

Forums

Breadcrumb NavXT
Breadcrumbs in the search loop (2 posts)

  1. hypeon
    Member
    Posted 1 year ago #

    Hello,

    I wish to place the breadcrumbs in the search results, however whenever I do this (through the search template) it outputs the same breadcrumbs as the page.

    Example: here

    I want to recreate something similar to this:
    https://www.gov.uk/search?q=Tax+Return

    Any help appreciated.

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

  2. John Havlik
    Member
    Plugin Author

    Posted 1 year ago #

    Internally, Breadcrumb NavXT caches the breadcrumb trail so that it doesn't regenerate it several times on multiple calls. This causes issues if you are expecting it to change per an item in an archive page. There isn't any really good ways to get around this behavior at the moment. There are two ways, but they will not work in Breadcrumb NavXT 5.0. They are:

    1) Before each call to bcn_display() place the following:

    global $bcn_admin;
    $bcn_admin->breadcrumb_trail->trail = array();

    2) Manually create a new instance of a bcn_breadcrumb_trail object and call the requisite member functions rather than using the bcn_display() wrapper.

    The internal structure of the plugin is changing in version 5.0 (git branch "Dancer"), and the above two methods will have to be adjusted to match the new structure. Though, I could probably add in something to bypass the caching.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Breadcrumb NavXT
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic