WordPress.org

Ready to get started?Download WordPress

Forums

wp_list_pages css help (6 posts)

  1. Lpspider
    Member
    Posted 5 years ago #

    I'm working on customizing the menu on a wordpress theme. I need css span to be applied inside the link. This works fine for normal links but for links from wp_list_pages it messes up the css.

    <li><?php wp_list_pages('title_li='); ?></li>
    <li><a href="#"><span>Title</span></a></li>
    	</ul>

    The CSS shows up fine with the link "Title" but shows up incorrect for wp_list_pages.

    Is there any way around this? Can I somehow edit the html around wp_list_pages to include span?

    Thanks!

  2. sancho320
    Member
    Posted 5 years ago #

    I would also like to know how to adjust this. I have looked at the code within the functions file, but no luck. This would be a great help in adding dynamic width graphic buttons.

    Thanks.

  3. @mercime
    Volunteer Moderator
    Posted 5 years ago #

    The following tutorial is about dynamic menu highlighting, but you'll get the drift - http://codex.wordpress.org/Dynamic_Menu_Highlighting
    Good luck.

  4. sancho320
    Member
    Posted 5 years ago #

    Thanks, mercime, but not quite what I was looking for. It appears the answer lies in the classes.php file. For those interested, I tried this and it worked like a charm!
    http://www.jasonwhitener.com/2008/02/01/wp_list_pages

  5. niiiiiic
    Member
    Posted 5 years ago #

    Thanks a ton Jason. A simple edit with the classes.php did the trick!

  6. Garry Chahal
    Member
    Posted 5 years ago #

    Create your navigation menu with ul or li tags, as we cant create a menu using span tag because WordPress generates the navigation menu dynamically from the database on the fly.

Topic Closed

This topic has been closed to new replies.

About this Topic