Automatically create links of new pages on a page (5 posts)

  1. venc
    Posted 7 years ago #

    Hello, I'm quite a nob when it comes to this service, but can read some coding.

    I just want to ask if anyone knows how can a link be created on a specific page when new pages of a group is created. I have searched around and have not found anything, maybe bad wording on my part.

    Let say, for example, every time I create a page related to Group X, the Group X's page would show the new link to the 'new page' automatically.


  2. MichaelH
    Posted 7 years ago #

    Try this, at least to get acquainted with the possibilities:

    1. Change to the WordPress Default theme
    2. Copy wp-content/themes/default/links.php to wp-content/themes/default/pageofpages.php
    3. Edit pageofpages.php and change it to look like this:

     * @package WordPress
     * @subpackage Default_Theme
    Template Name: PageofPages
    <?php get_header(); ?>
    <div id="content" class="widecolumn">
    <?php wp_list_pages(); ?>
    <?php get_footer(); ?>

    4. Vist Pages->Add new and create a Page call it "My Page listing of Pages" and in the Template pulldown, select "PageofPages"
    5. Then see how you like that by visting your blog.
    6. If necessary read wp_list_pages() to decide how you might want to limit what that list of pages displays (e.g. you might decide to use custom fields to assign some value to what you call Group X pages so you would use the meta_key and meta_value parameters).

  3. venc
    Posted 7 years ago #

    Thank you so much for the quick reply. I'll be trying that tonight!

  4. venc
    Posted 7 years ago #

    Hey, I have to use the default Theme only or can I use a different theme?


  5. MichaelH
    Posted 7 years ago #

    Oh you can use a different theme, but might need to adjust your div to your theme. The concept of
    Template Hierarchy applies, regardless of themes.

Topic Closed

This topic has been closed to new replies.

About this Topic