Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #81499
    oleymedia
    Participant

    I want the breadcrumb to appear in the content area (not directly below the menu – I don’t want it pushing down the sidebar)

    I have enabled the breadcrumb in “Customise”

    I have then tried to move it by remove the original action and adding a new one:

    remove_action( 'catchresponsive_after_header', 'catchresponsive_add_breadcrumb', 50 );
    add_action( 'catchresponsive_before_page_container', 'catchresponsive_add_breadcrumb', 20);

    This is adding the breadcrumb action exactly where I want it BUT it is not removing the original action (therefore I have 2 breadcrumbs appearing)

    What is wrong with my call? Why isn’t this operating properly?

    remove_action( 'catchresponsive_after_header', 'catchresponsive_add_breadcrumb', 50 );

    #81506
    Mahesh
    Participant

    Hi @oleymedia,

    The code you’ve used for adding and removing action is correct if you’re within theme territory, but for child theme you have to hook it into init. You can do it as follows:

    add_action( 'init' , 'catchresponsive_child_add_and_remove' , 15 );
    function catchresponsive_child_add_and_remove() {
            remove_action( 'catchresponsive_after_header', 'catchresponsive_add_breadcrumb', 50 );
    	add_action( 'catchresponsive_before_page_container', 'catchresponsive_add_breadcrumb', 20);
    }

    Also the remove_action() needs to have the same priority when it was added.

    Regards,
    Mahesh

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘How to remove breadcrumb action’ is closed to new replies.