WordPress.org

Ready to get started?Download WordPress

Forums

Pages displaying links to sub-pages (3 posts)

  1. paulcjones
    Member
    Posted 10 months ago #

    I'm looking for a "how - to" or a plugin that will provide me with a single page that dynamically shows me sub-pages.

    My usage is this:

    I receive reviews from people for races. The Parent page is the form for them to submit the race review to me.

    Right now, every time I get a review, I create a sub-page for the race, and add each review as it comes in. Then I drag that race to a menu to display it.

    I want to switch this drop down menu to a single page that will show me each sub-page as I add them to my site.

    Thoughts?

  2. wpfan1000
    Member
    Posted 10 months ago #

    http://codex.wordpress.org/Function_Reference/wp_list_pages

    This is a shortcode I wrote for my needs - hopefully you can use this as is or modify to your needs. Not garanteed to be 100% perfect.

    Just put the code in your functions.php file.

    // ---------------- Shortcode for Subpages list
    
    function mysubpageslist()
    	{
    		// Exclude the heading using 'title_li='
    		// Show only child pages using child_of='.$post->ID.
    		// Use echo=0 to prevent output of shortcode to printed before text in page or post
    		// Sort by page order using 'sort_column=menu_order'
    		// Separate parameters with a &
    
    		global $post;	// Must have this to support $post->ID
    
      		return '<ul class="mysubpageslist">'.wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0&sort_column=menu_order').'</ul>';
    	}
    
    add_shortcode('mysubpageslist', 'mysubpageslist');
    
    // usage: [mysubpageslist]

    Then just put [mysubpageslist] in your page.

  3. renjithmb22
    Member
    Posted 10 months ago #

    i think pagelist plugin can help you.
    http://wordpress.org/plugins/page-list/

    note: make sure you create subpage to proper parent page.

Reply

You must log in to post.

About this Topic