Forums

[resolved] Removing generated class in the page list menu (8 posts)

  1. babypress
    Member
    Posted 4 years ago #

    Hi there, I have been trying to nut this out but get stuck on why the code sends back my list items with a class="page_item page-item-2?

    I have coped my sidebar code that displays the list and the code that gets outputted by wordpress?

    Any suggestions to get a clean
    <-li> output <-/li>
    without the class="page_item page-item-2 as shown below?

    <div id="nav">
    <ul>
    <?php wp_list_pages('title_li='); ?>
    </ul>
    </div><!-- end nav -->

    This is what the output looks like

    <ul>
    <li class="page_item page-item-2"><a href="http://help.com.au/?page_id=2" title="About">About</a></li>
    </ul>
  2. Ivovic
    Member
    Posted 4 years ago #

    I'd like to know why the output is a problem for you.

    it validates, it gives you options, but you don't have to use them, so why is it causing you trouble? - often people focus on the wrong thing to fix, which I think is what you're doing here.

    I asked this of someone the other day, and he immediately turned into a spastic, so I hope you don't take it the wrong way but:

    What do you REALLY want? - choking this output can't be it.

  3. babypress
    Member
    Posted 4 years ago #

    Problem is that my css has no effect for `#nav ul li a:hover{
    color: #CD1041
    }`

    But I will research it some more

  4. Ivovic
    Member
    Posted 4 years ago #

    it could be a case of nested ULs...

    try #nav ul li ul li a:hover

    I find that once you get specific, you have to be really specific.

    you could also try .page_item a:hover (which is why the page_item is there).

  5. babypress
    Member
    Posted 4 years ago #

    Thanks Ivovic, I checked for nested ul li but that is not a problem. I will do some more research on the matter

  6. Ivovic
    Member
    Posted 4 years ago #

    did you try .page_item a:hover?

  7. babypress
    Member
    Posted 4 years ago #

    I had to be super specific and with your help this works now with the following:
    #nav ul li.page_item a:hover

    Thanks heaps

  8. Ivovic
    Member
    Posted 4 years ago #

    I've got a few specific ones in my style sheet as well. For some reason well-nested classes sometimes don't activate unless you're extremely explicit.

    Anyway, I'm glad you sorted it out in lieu of hacking the core code.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.