WordPress.org

Ready to get started?Download WordPress

Forums

Can you set the parent of a post as a Page? (2 posts)

  1. room58
    Member
    Posted 8 years ago #

    I have a site build of Pages. Using the Fold Page List plugin, I can automatically set the styles of my menu items to show that they are currently selected, and to display the sub nav items required. My post entries sit in the News section of my site (split into Archive and Latest). When I click on a single post to view it, my navigation reverts to everything unslected. I'm guessing this is because the Post is not a Page and therefore the Fold Page List can't get a parent.

    Can I set the single.php to automatically open the correct level of my navigation?

  2. moody
    Member
    Posted 8 years ago #

    A little late on the reply, but I think it'll help if anyone is looking for a solution to a similar issue.

    I'm assuming by "open" you mean to have the navigation element highlighted for your post.

    You will have to add some conditional arguments with your wswwpx_fold_page_list function.

    My php knowledge is horrible, but if you're smart then It may look something like this:

    if have_posts() that are posts and not pages then
    <li class="current_list_item"><a href="">news</a></li>
    else
    <li><a href="">news</a></li>
    endif;
    <?php wp_list_pages('sort_column=menu_order&title_li='); ?>

    Good Luck!

Topic Closed

This topic has been closed to new replies.

About this Topic