What do I change this code to?

10 replies
I want to have a static menu at the top of each page on my site.

<ul>
<li<?php if (is_home()) echo " class=\"selected\""; ?>><a href="<?php bloginfo('url'); ?>">Home</a></li>
<?php wp_list_pages('title_li=&depth=1'); ?>
</ul>

This is the code that's there - I just want regular links
#change #code
  • Profile picture of the author ReikiGirl
    Originally Posted by ReikiGirl View Post

    I want to have a static menu at the top of each page on my site.

    <ul>
    <li<?php if (is_home()) echo " class="selected""; ?>><a href="<?php bloginfo('url'); ?>">Home</a></li>
    <?php wp_list_pages('title_li=&depth=1'); ?>
    </ul>

    This is the code that's there - I just want regular links
    <ul>
    <li><a href="http://www.mysite.com">Home</a></li>
    <li><a href=http://www.mysite.com/love>Love</a></li>
    <li><a href=http://www.mysite.com/life>Life</a></li>
    <li><a href=http://www.mysite.com/peace>Peace</a></li>
    </ul>


    Would it go like this maybe?
    {{ DiscussionBoard.errors[3706958].message }}
    • Profile picture of the author Evan-M
      Originally Posted by ReikiGirl View Post

      <ul>
      <li><a href="http://www.mysite.com">Home</a></li>
      <li><a href=http://www.mysite.com/love>Love</a></li>
      <li><a href=http://www.mysite.com/life>Life</a></li>
      <li><a href=http://www.mysite.com/peace>Peace</a></li>
      </ul>


      Would it go like this maybe?
      this will work if you add the styles to your sheet for

      ul {} and li {}
      add your style code between the {}

      if they are already there you can do the rest by making adjustments in your stylesheet for layout

      you would be better off creating styles to apply to the menu only thoe, as the code you have above, if you style it like that it will apply to any ul or li

      create your own styles then use

      <ul class="class name">
      <li class="class name"><a href="#"></a></li>
      <li class="class name"><a href="#"></a></li>
      <li class="class name"><a href="#"></a></li>
      <li class="class name"><a href="#"></a></li>
      </ul>
      Signature

      Evan-M

      Easily The Worlds Best Wordpress Popup plugin

      Visit Website Design Firm For All Your Wordpress Coding Needs

      {{ DiscussionBoard.errors[3713096].message }}
      • Profile picture of the author ReikiGirl
        Originally Posted by Evan-M View Post

        this will work if you add the styles to your sheet for

        ul {} and li {}
        add your style code between the {}

        if they are already there you can do the rest by making adjustments in your stylesheet for layout

        you would be better off creating styles to apply to the menu only thoe, as the code you have above, if you style it like that it will apply to any ul or li

        create your own styles then use

        <ul class="class name">
        <li class="class name"><a href="#"></a></li>
        <li class="class name"><a href="#"></a></li>
        <li class="class name"><a href="#"></a></li>
        <li class="class name"><a href="#"></a></li>
        </ul>

        Evan - thank you. I'm just winging it, it did work - it's on wordpress and in the header - I have no idea about style sheets and creating styles and stuff.

        I just guess, sometimes it works, most of the time it doesn't. I'm a persistant one though.
        {{ DiscussionBoard.errors[3713204].message }}
  • Profile picture of the author ReikiGirl
    Yep that was it. Leave me alone with myself long enough and I'll probably figure it out.

    Am I talking to myself?
    {{ DiscussionBoard.errors[3706995].message }}
  • Profile picture of the author SteveJohnson
    Signature

    The 2nd Amendment, 1789 - The Original Homeland Security.

    Gun control means never having to say, "I missed you."

    {{ DiscussionBoard.errors[3716946].message }}
  • Profile picture of the author ReikiGirl
    Definitely an awesome video. I feel like I am setting that up, but at the beginning and damn, I've been doing this 11 years! lol
    {{ DiscussionBoard.errors[3719444].message }}
  • Profile picture of the author oknoorap
    Its wordpress right? why don't use wp_nav_menu? this feature comes with wordpress 3.0, see the documentation.

    Function Reference/wp nav menu « WordPress Codex
    {{ DiscussionBoard.errors[3725766].message }}
  • Profile picture of the author filthy
    All the automation in that model of Honda. Nice video.
    {{ DiscussionBoard.errors[3817194].message }}

Trending Topics