Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #998000

    Dear Enfold,

    Could you please remove the category from the ‘breadcrumbs’? Is it doable with CSS?

    screenshot
    screenshot: https://imgur.com/a/vx7Ulj2

    Feel free to instantly fix this using the personal informatin below.

    Please not that the website currently is very slow.

    Thanks in advance ;).
    Kind regards

    #998343

    Hey jeroenvandessel,

    I added following code to the functions.php to solve the issue:

    
    add_filter( 'avia_breadcrumbs_trail', 'avia_breadcrumbs_trail_mod', 50, 2 );
    function avia_breadcrumbs_trail_mod( $trail, $args ) 
    {
    	foreach ($trail as $key => $value)
    	{
    		if(strpos($value, '/category/vacatures/') !== false)
    		{
    			unset($trail[$key]);
    		}
    	}
    	return $trail;
    }
    

    The code removes the category link from the breadcrumb.

    Best regards,
    Dude

    #998347

    Dear Dude,

    Looks great! Thanks!
    Does the change stay if I update Enfold in the future?

    Kind regards,

    #998432

    Hi,

    No, because you’re not using a child theme. If you want an update-safe solution you could create a custom plugin with my code.

    1) Delete the code I added to the functions.php file
    2) Create a text file and paste this code into it:

    
    <?php
    /*
    Plugin Name: Enfold Custom Code
    Description: Contains Enfold Custom Code
    Version:     1.0
    Author:      InoPlugs
    Plugin URI:  https://inoplugs.com
    Author URI:  https://inoplugs.com
    */
    
    /**
     * Breadcrumb Fix
     *
     * @return array
     */
    
    add_filter( 'avia_breadcrumbs_trail', 'avia_breadcrumbs_trail_mod', 50, 2 );
    function avia_breadcrumbs_trail_mod( $trail, $args ) 
    {
    	foreach ($trail as $key => $value)
    	{
    		if(strpos($value, '/category/vacatures/') !== false)
    		{
    			unset($trail[$key]);
    		}
    	}
    	return $trail;
    }
    

    3) Save the text file with a php extension – i.e. call it “enfold_plugin.php” (without the quotes).
    4) Go to Plugins > Add New and upload the file. Then activate it like a standard wordpress plugin.

    Best regards,
    Dude

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.