WordPress.org

Ready to get started?Download WordPress

Forums

How to show only top level pages? (5 posts)

  1. worldsnapper
    Member
    Posted 3 years ago #

    Hi,

    I have found the code which should sovle my problem of only showing top-level pages in on the front page, but not sure how to enter it into the Sidebar code template. I found the line in which it should go, but by pasting it in there I made the sidebar dissapear!

    The code is: 'sort_column=menu_order&depth=1'

    and it should go in the line: <?php wp_list_pages('title_li=<h1>Pages</h1>'); ?>

    I am using the Aurora theme...

    Thanks

  2. jessn
    Member
    Posted 3 years ago #

    Try this maybe

    <?php wp_list_pages('sort_column=menu_order&depth=1&title_li=<h1>Pages</h1>'); ?>
  3. worldsnapper
    Member
    Posted 3 years ago #

    Hi Jessn,

    Thanks for the reply. The sidebar is now back, but the sub-pages are still visible...

    Andrew

  4. jessn
    Member
    Posted 3 years ago #

    Take a look at this example from the codex. It writes the title_li a little differently than yours and might be the issue:

    <?php wp_list_pages('sort_column=menu_order&title_li=<h2>' . __('Prose') . '</h2>' ); ?>

    So maybe try:

    <?php wp_list_pages('sort_column=menu_order&depth=1&title_li=<h1>' . __('Pages') . '</h1>'); ?>

  5. worldsnapper
    Member
    Posted 3 years ago #

    Still not working.. god I have code sometimes!

    Thanks anyway.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.