• mscheperle

    (@mscheperle)


    Trying to edit navigation links on a friend’s website: http://www.thesaucetool.com/

    Specifically “BBQ Stuff” and “Licensing”. The theme was custom built by a developer a few years back. There is no “Menu” link under the Appearance section in the WordPress dashboard.

    I’ve been looking through the code with Firebug developer tool but it looks like the navigation links live in the html. I’ve also looked through the style.css and other .php files available in the Appearance Editor.

    I know the version is outdated, but I don’t want to mess anything up by updating it.

Viewing 13 replies - 1 through 13 (of 13 total)
  • Look in page.php, if not found, look in loop-page.php.

    EDIT: That part is site wide, so it must be in index.php, the template might be included so you might not see it but you will see the require or get_template_part()

    Thread Starter mscheperle

    (@mscheperle)

    Thanks for the quick reply. I figured out that the navigation is css sprites. I found where I can edit the sprite image to change the look of the navigation buttons, but I am unable to edit the links.

    I checked the index.php, but did not see where I could edit the links. The sprites section in the style.css did not have the links either.

    Thanks again paulwpxp. Any additional help is much appreciated.

    @mscheperle

    The <ul> has a class header in it, and it contains the logo, and it appears on every page, so it must be in header.php.

    Thread Starter mscheperle

    (@mscheperle)

    I believe you are right. Here’s what the code looks like:

    <body <?php body_class(); ?>>
    <div class="top wrapper">
    	<div class="container">
    		<ul class="header nav">
    			<?php wp_list_pages('title_li=&include=13'); ?>
    			<?php wp_list_categories('title_li=&include=7&hide_empty=0'); ?>
    			<?php wp_list_pages('title_li=&include=19'); ?>
    			<?php wp_list_categories('title_li=&include=1&hide_empty=0'); ?>
    			<?php wp_list_pages('title_li=&include=9,6'); ?>
    		</ul>

    I’m not sure how to add the link though. Here it is:
    http://thesaucetool.blogspot.com/

    MisterManu

    (@mistermanu)

    Add the code bellow to your functions.php file, Anywhere but not between other code in case you mess things up. You can put it all the way at the end of functions.php.
    Make a copy of it and save it somewhere before adding the code just in case.
    What it will do for your is basically add the menus section in your wordpress backend. That should help you redo the menu naviguation.

    /****************************************************/
    /* Menus*/
    /****************************************************/
    function register_my_menus() {
      register_nav_menus(
        array( 'header-menu' => __( 'Header Menu' ) )
    
      );
    }
    add_action( 'init', 'register_my_menus' );

    Then in your CSS, adjust the positions of associated sprite bg img for each link. You will have to make a new one though, with the same type face used.

    The benefit of replacing that with wp_nav_menu(), is that so you can use the admin ui for these links, but actually there are other ways too.

    You can use the same method as it is, keep using wp_list_pages() and wp_list_categories(), just change the id to the page/cat-archive of your choice, arrange the order of <li> as you like.

    Or

    You can add/change links at anywhere you like in the existing code

    <ul class="header nav">
    	<?php wp_list_pages('title_li=&include=13'); ?>
    	<?php wp_list_categories('title_li=&include=7&hide_empty=0'); ?>
    	<?php wp_list_pages('title_li=&include=19'); ?>
    	<?php wp_list_categories('title_li=&include=1&hide_empty=0'); ?>
    	<?php wp_list_pages('title_li=&include=9,6'); ?>
    	<li class="my-menu-item-1"><a href="http://google.com">Google</a></li>
    </ul>

    Or

    You can just hardcode the whole thing instead, this’s even easier.

    <ul class="header nav">
    	<li class="my-menu-item-1"><a href="http://google.com">Google</a></li>
    	<li class="my-menu-item-2"><a href="http://apple.com">Apple</a></li>
    	<li class="my-menu-item-3"><a href="http://twitter.com">Twitter</a></li>
    </ul>
    WPyogi

    (@wpyogi)

    I know the version is outdated, but I don’t want to mess anything up by updating it.

    On a slight divergence – presumably you are aware that running such an outdated version of WP is a security risk? (If your site gets hacked, that will be a much bigger mess πŸ™ .)

    Ahh, yes, the site is still on WordPress 2.9.2, that’s a long time ago.

    If not yet, you should backup the site
    http://codex.wordpress.org/WordPress_Backups

    and make a local dev site to inspec what part of the theme needs any updates.

    WPyogi

    (@wpyogi)

    @paulwpxp – that’s probably why the menu business is not “normal” – menus were part of 3.0 right?

    aha, totally missed it at first, 2.9.2 is a long way back ( early 2.9 ), so the theme is built at the time there was no wp_nav_menu().

    MisterManu

    (@mistermanu)

    Indeed, don’t use my code either then πŸ˜‰

    Thread Starter mscheperle

    (@mscheperle)

    Thanks a ton paulwpxp, WPyogi, and MisterManu.

    I’m going to backup the site first, and then update WordPress.

    Just to clarify: I should not add any of the suggested code to my functions.php file or my CSS?

    wp_nav_menu() will not work on WP 2.9.2 , so at this moment you can use any other method, just not the wp_nav_menu().

    After you have your WP updated, then you can use wp_nav_menu(), but you don’t have to, it’s up to you to decide what serves you best.

    Anyway, the hard part is CSS sprite. Also the space available in that area, due to existing design, if you want to put more links in there, you have to decrease the size(height) of each one.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Edit navigation links on custom theme’ is closed to new replies.