• Vince

    (@vincentrich)


    Is there any way to hide the current item without using a <span style=”display:none”> ?

    I would also like to hide the separator before the current item.

    I would like to see something like:

    Home > Category

    And not:

    Home > Category >

    I played around with the settings and found ways to add a prefix to pages/posts to make this work but when I hide the Home link…

    I get this:

    > Category

    This is quite a headache for me at the moment.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author John Havlik

    (@mtekk)

    It is quite simple, look at this post: https://mtekk.us/archives/guides/conditionally-remove-home/

    Change array_pop to array_shift and remove the if statement that checks is_page.

    mtekk,

    I am trying to hide the current item and I followed your instructions but get the following warning:

    Warning: Parameter 1 to foo_pop() expected to be a reference, value given in

    Can you explain how to do this in a bit more detail?

    Thanks.

    Plugin Author John Havlik

    (@mtekk)

    What version of Breadcrumb NavXT are you using, and where did you place the code?

    You can try removing the & before $trail in the line:
    function foo_pop(&$trail)
    so it would become
    function foo_pop($trail)

    Hi mtekk,

    I thought this was working but what it is doing is removing the current page item, but one category/page up has the link of the current page item.

    So, for example, I have the following before using the function:

    Home > Catalog > Albums > XX001 My Release featuring Super Vocalist and Remixer

    As you can see I want to remove these long names.

    Using the function, I get:

    Home > Catalog > Albums

    but the “Albums” crumb links to the “XX001 My Release featuring Super Vocalist and Remixer” page, not the “Albums” page.

    Here’s what I have in the functions.php file of my theme:

    function foo_pop($trail)
    {
    
      {
        array_shift($trail->trail);
      }
    }
    add_action('bcn_after_fill', 'foo_pop');

    So, it is removing the current item but shifting the permalinks somehow.

    While I’m thinking about this, a feature request would be to use the slug of the current page item.

    Many of my pages are products and have quite long page names, thus being able to use the slug (either for the current item or globally) would be ideal.

    Plugin Author John Havlik

    (@mtekk)

    If you are going to shift the current item off of the trail, it does not make sense to keep the “Link Current Item” setting checked. The current method of creating the current item link is the cause of this. It will be changed in a future version of Breadcrumb NavXT (4.0).

    BTW. You can limit the number of characters a breadcrumb can contain in the trail using the “Breadcrumb Max Title Length” option.

    Mtekk,

    That makes sense.

    Actually I am using the character limit to achieve close to what I want. That said, as I mentioned above being able to use the slug instead of the full page title would be ideal.

    Thanks for your help.

    Joshua

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Breadcrumb NavXT] Hiding Current Item?’ is closed to new replies.