WordPress.org

Ready to get started?Download WordPress

Forums

current_page_item hack for custom post typs (4 posts)

  1. daveleeone
    Member
    Posted 2 years ago #

    Hi there, i found a solution to add the .current_page_item

  2. daveleeone
    Member
    Posted 2 years ago #

    sorry for double post!!!

    Hi there, i found a hack on core.trac.wordpress.org/ to setting the .current_page_item on wp_list_pages() in combination with Custom Post Typs.

    But this Hack supports only the .current_page_item CSS-Class.
    The CSS-Class of the parent Element (.current_page_parent) is not set.

    Any ideas?

    her is the code

    function file:
    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    I use jquery at the moment to generate CSS-Class of the parent Element

    jquery file

    $(document).ready(function(){
    	$('.submenu li:has(li.current_page_item)').addClass('parent_page_item');	
    
    });

    Has anyone a idea how can i implement this feature?

  3. federicar
    Member
    Posted 2 years ago #

    I registered to say: Thanks!

  4. Tobias Nygren
    Member
    Posted 2 years ago #

    Hi Dave!

    (I'm really sorry for my awfully late reply. I didn't notified about your support thread in the Trac. I just saw it now when another guy posted in it.)

    If this still is relevant: could you paste your register_post_type() code on pastebin?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.