WordPress.org

Ready to get started?Download WordPress

Forums

Customizr
[resolved] Move Tagline (17 posts)

  1. dmd54
    Member
    Posted 3 months ago #

    How can I move the tagline from the navigation menu so that it is underneath the logo?

    thanks

  2. ElectricFeet
    Member
    Posted 3 months ago #

    You'll need the following in your child-theme's php:

    // Move tagline under logo
    // Hook the deletion on the wp_head hook, so it's executed before any html
    add_action ( 'wp_head' , 'move_my_socials');
    function move_my_socials() {
    	// Remove socials from the navbar
        remove_action ( '__header' ,  array( TC_header_main::$instance , 'tc_tagline_display' ) , 20 );
        remove_action ( '__navbar' ,  array( TC_header_main::$instance , 'tc_tagline_display' ) , 20 );
        // Put them back under the logo
        add_action ( '__after_logo' , array( TC_header_main::$instance , 'tc_tagline_display' ) , 20, 1 );
    }

    Checkout How to customize Customizr if you've never done this.

  3. ElectricFeet
    Member
    Posted 3 months ago #

    Oops just had it pointed out that 'move_my_socials' is not a very good name for the function. Reuse old code? Me?

    Change 'move_my_socials' to 'move_my_tagline'

    :-)

  4. dmd54
    Member
    Posted 3 months ago #

    thanks - will give that a try.

  5. dmd54
    Member
    Posted 2 months ago #

    Cheers for that, worked perfectly. And if I want to completely remove the social icon block from the header can you help with that?

    thanks

  6. dmd54
    Member
    Posted 2 months ago #

    So - the above php worked on my localhost but when I uploaded the theme I'm receiving an error

    Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'move_my_tagline' was given in /home/content/83/7027783/html/hammertime/wp-includes/plugin.php on line 470

    the theme is live on danielpaymar.com/hammertime

    any ideas how to solve this?

    thanks

  7. ElectricFeet
    Member
    Posted 2 months ago #

    You need to change 'move_my_socials' to 'move_my_tagline' in both places. Did you only change one?

  8. dmd54
    Member
    Posted 2 months ago #

    I certainly did. Totally missed that. Thanks!

    ...and to completely lose the Socials from the header, is there a similar action I can use?

  9. dmd54
    Member
    Posted 2 months ago #

    Also - the error is gone but the tagline seems to be completely removed now as well.

  10. dmd54
    Member
    Posted 2 months ago #

    Ok - figured it out. I had removed the action in the header php, so reinstated that and added comments to stop the rendering of the socials.

    thanks again for the help

  11. d4z_c0nf
    Member
    Posted 2 months ago #

    But there is an option in Appearance -> Customize -> Social links, to not display socials in header. Then to hide also the container div of the removed social links:

    .tc-header .social-block {
        display: none;
    }

    Changing core files isn't really needed

  12. dmd54
    Member
    Posted 2 months ago #

    d4 - true but when I used display none, the block element was still present which was pushing the navigation menu over. So it works better to just strike it out completely.

  13. Andrew
    Forum Moderator
    Posted 2 months ago #

    Can you link the page in question? Maybe it's not the social-block you need to display none.

  14. dmd54
    Member
    Posted 2 months ago #

    Hi Andrew - it's at danielpaymar.com/hammertime

    ...but as far as I'm concerned it's working just the way I need it now.

  15. d4z_c0nf
    Member
    Posted 2 months ago #

    If you use display: none that block will not make "volume" so doesn't push anything.
    If you could revert the changes and let us see the issue, would be better.

  16. dmd54
    Member
    Posted 2 months ago #

    I would like to but the 3g i'm using in Indonesia is so terrible it takes ages to make any changes. All I can say is that I tried display none and the nav menu was in the center and using firebug the div for the social icons was still present, just with nothing in it.

    thanks for suggestions.

  17. d4z_c0nf
    Member
    Posted 2 months ago #

    Of course that div is still present, since its html (an empty div) is still printed. But, again, with display:none it will make no volume, so will not push anything.
    You changed a core file to achieve the same visual result, which is wrong, 'cause:
    1) if you changed the file in customizr then you have to re-apply the change after each update
    2) if you copied that file in your child-theme tree then, in future, you might miss some customizr improvements on that file.

    Alternatively if you don't want that div printed at all revert your changes and use this code in your child-theme functions.php:

    add_action('wp_head', 'remove_social_in_header');
    function remove_social_in_header(){
        remove_action('__navbar', array(TC_header_main::$instance, 'tc_social_in_header'));
    }

Reply

You must log in to post.

About this Theme

About this Topic