• Resolved cyborg4

    (@cyborg4)


    Hi,
    Probably a stupid question, but is there any way to add a custom item to the navigation bar (NOT the menu) at the top of the theme, underneath the title and tagline?

    Thanks!

    Curtis

Viewing 11 replies - 1 through 11 (of 11 total)
  • There is a section named “Links” in Appearance > Menus to add custom links. In case you don’t see it click on “Screen Options” on the top right corner and tick links.

    Thread Starter cyborg4

    (@cyborg4)

    Hi,

    Thanks, that’s partly solved my problem, but I also want a Login/Register link to appear there if you’re not logged in to /wp-login, but not when you’re logged in. Is there any way to do this?

    Once again, thanks for the prompt response!

    Curtis

    Hi Curtis,

    That would require you to modify code.

    It is highly recommended to create a child theme, activate it and place the following code in the wp-content/themes/decode-child/functions.php file.

    <?php
    add_filter('wp_nav_menu_items', 'login_logout_menu_link', 11, 2);
    function login_logout_menu_link( $items, $args ) {
        $items .= '<li>'. wp_loginout( '', FALSE ) .'</li>';
        $items .= wp_register( '<li>', '</li>', FALSE );
        return $items;
    }

    The closing PHP tag ?> should be omitted.

    Thread Starter cyborg4

    (@cyborg4)

    Hi,

    Where should this code be placed in functions.php? I tried it but it didn’t work – the homepage just returned a blank page.

    Thanks!

    Curtis

    Did you create and activate a child theme?

    The wp-content/themes/decode-child/functions.php file doesn’t exist, you have to create one and place the code.

    Thread Starter cyborg4

    (@cyborg4)

    I was trying to do it in the main theme file. I have a backup of the old theme files (and the entire WP install).

    That is not at all recommended as all changes in the main theme’s files will be overwritten when you update the theme.

    If you remove the opening PHP tags <?php it’ll work in the main functions.php file.

    You have been warned!

    Thread Starter cyborg4

    (@cyborg4)

    OK, I’ll make a child theme then. Thanks, I’ll reply when it’s done!

    Thread Starter cyborg4

    (@cyborg4)

    Hi,

    Using the child theme breaks Decode. It displays in a nearly all-text manner, with only a few images remaining. It also doesn’t use the right fonts.

    Any ideas?

    Curtis

    Did you remember to import Decode’s stylesheet?

    @import url("../decode/style.css"); needs to be at the top of your child theme’s style.css, right after all the header information.

    Thread Starter cyborg4

    (@cyborg4)

    Hi,

    Did you remember to import Decode’s stylesheet?

    Yeah, I referenced it.

    But.. I have sorted the problem by adding a Login/Register widget into the sidebar in Decode. Thanks so much everyone for the help and advice, I will be continuing to use this theme and am about to give it a great review!

    Once again, thanks for the fast help!

    Curtis

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Adding a page to navigation?’ is closed to new replies.