• Resolved pirro70

    (@pirro70)


    hi folk
    I need to move the menu on top, I thought to get it by changing the priority add_action ( '__header' , array( $this , 'tc_navbar_display' ) , 30 ); in the TC_header_main class.
    But every theme update I’ll lost this change, and then how can I get it in functions.php of the child theme?
    I’ve already tried to remove that action in the functions (and then re-add with other priorities) but does not work
    Thans in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • remove + add action in the child-theme functions.php is the right choice.
    Probably it didn’t work for another reason, you should execute does at a certain “time”.
    Say you had:
    a)

    remove_action('__header', array(TC_header_main::$instance, 'tc_navbar_display', 30) );
    add_action('__header', array(TC_header_main::$instance, 'tc_navbar_display', 0) ); /*don't know what priority you want to use*/

    you should do something like:

    add_action('template_redirect', 'move_navbar', 100);
    function move_navbar(){
    // put the a) block here
    }

    Hope this helps

    Thread Starter pirro70

    (@pirro70)

    thanks d4z great!!! I also thought it was a problem of execution time.
    you have only made a small mistake in block A, you have included the priority argument in the array.
    The right is:

    remove_action('__header', array(TC_header_main::$instance, 'tc_navbar_display'), 30 );
    add_action('__header', array(TC_header_main::$instance, 'tc_navbar_display'), 1 );

    thanks a lot
    sei un mito

    Yeah right.. Sorry I’ve written it with a smartphone and forgot a bracket.. Then added it in the wrong place 😉 thanks for reporting the correct code.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘menu on top’ is closed to new replies.