WordPress.org

Ready to get started?Download WordPress

Forums

Multiple wp_list_pages give no current page class... (11 posts)

  1. Rick Lamers
    Member
    Posted 4 years ago #

    Dear WordPress Pro's,

    I would like to ask how I can get to make the wp_list_pages give the current page the "current_page_item" class when it's requested twice.

    I have a menu in the header section of the site but also in the Sidebar.
    Now In the first wp_list_pages request it is actually highlighted because of the class current_page_item. But when I wp_list_pages it again it doesn't give a current page class...

    Any1?

    Greeting,
    Rick Lamers

  2. alchymyth
    Forum Moderator
    Posted 4 years ago #

    can this be seen somewhere?
    without a link, there is not much to comment on this issue.

    did you check the html code in the browser to see if there are no 'current_page_item' classes with the second page list?

  3. Rick Lamers
    Member
    Posted 4 years ago #

    http://pulpfix.nl/index.php/videos/motion-graphics/ << Here's the link.

    I did check for the class but it's not there...

  4. alchymyth
    Forum Moderator
    Posted 4 years ago #

    i think it is not a failure of the wp_list_pages() -

    there is probably a custom query in the main bit of the page, that is changing the querystring.

    try to add a 'wp_reset_query();' before you get the sidebar.

  5. Rick Lamers
    Member
    Posted 4 years ago #

    How do you know stuff like this!? :P

    It's crazy you fixed it!

    Thank you, very very much.

  6. alchymyth
    Forum Moderator
    Posted 4 years ago #

    you are welcome.

    'wp_reset_query();' is a little known panacea (cure-all) for many problems after custom queries.

  7. Rick Lamers
    Member
    Posted 4 years ago #

    Ill keep that in mind ;) Are you a developer for WordPress or..?

  8. alchymyth
    Forum Moderator
    Posted 4 years ago #

    let us say, i do like problem solving; and i always liked logic and programming.
    if i am getting too bored, i do sodukos.

    and, yes, i do some theme programming as well.

  9. Rick Lamers
    Member
    Posted 4 years ago #

    Haha ok cool, Im getting more and more familiar with programming PHP and jQuery and I pretty much master HTML/CSS which isn't that hard .. :P

    You have a portfolio? Since you'r more advanced then I am I could maybe learn some things :)

  10. Jguiss Webmaster
    Member
    Posted 3 years ago #

    Thanks for the tips !

  11. ruleone
    Member
    Posted 3 years ago #

    alchymyth, I love you. Brilliant. This has been plaguing me for months, because I couldn't find the answers. Turns out I was asking the wrong questions. :D

Topic Closed

This topic has been closed to new replies.

About this Topic