Support » Plugin: Breadcrumb NavXT » Removing the DAY from the breadcrumb date trail

  • Thanks for this excellent plugin — I just installed it and am experimenting. My preference is for a date breadcrumb trail, like this:

    Home > 2018 > December > 14 > This Post

    But on a blog that only posts three or four times a week there’s no need to include the day (since there’s never more than one post per day). I would like the trail to be:

    Home > 2018 > December > This Post

    Is there a way to eliminate the DAY from the date trail? I see some modifications can be made in the Miscellaneous tab for the plugin’s settings, but I’m not seeing how to do this specific change. (Maybe I’m missing it.)


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


    You’ll need to use the bcn_after_fill action to remove the day breadcrumb from the trail when it is present. You should be able to loop through the members of the breadcrumbs member array in the passed in bcn_breadcrumb_trail object. You’ll want to use the bcn_breadcrumb::get_types() function to get the types array and check for ‘date-day’.

    A skeleton of what to put into your action function:

    foreach($breadcrumb_trail->breadcrumbs as $key => $breadcrumb)
    	if(in_array('date-day', $breadcrumb->get_types())
    		//Code to remove breadcrumb here suggest using array_splice
Viewing 1 replies (of 1 total)
  • The topic ‘Removing the DAY from the breadcrumb date trail’ is closed to new replies.