WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Remove Specific Pages from 404 Archive Page (5 posts)

  1. Waup
    Member
    Posted 11 months ago #

    I'm trying to remove specific pages (inc. password protected ones) and URL parent pages (i.e. http://www.mysite.com/hiddenparent/example post from the archive and 404 archive pages. Can't find a tutorial anywhere - anyone know how to fix this? Thanks

  2. KrissieV
    Member
    Posted 11 months ago #

    Without seeing how your site is set up, it's hard to troubleshoot, but I'd suggest starting here... trying to find this in the template files and using the exclude parameter to exclude the pages you don't want listed.

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

  3. Waup
    Member
    Posted 11 months ago #

    Thks Krissie. I changed:

    <h4><?php _e( 'Site-Map:', 'genesis' ); ?></h4>
    			<ul>
    				<?php wp_list_pages( 'title_li=' ); ?>
    			</ul>
    
    			<h4><?php _e( 'Categories:', 'genesis' ); ?></h4>
    			<ul>
    				<?php wp_list_categories( 'sort_column=name&title_li=' ); ?>
    			</ul>

    to:

    <h4><?php _e( 'Site-Map:', 'genesis' ); ?></h4>
    			<ul>
    				<?php wp_list_pages( 'title_li='  'exclude=PostNo' ); ?>
    			</ul>
    
    			<h4><?php _e( 'Categories:', 'genesis' ); ?></h4>
    			<ul>
    				<?php wp_list_categories( 'sort_column=name&title_li=' ); ?>
    			</ul>

    With the right post number in there, and it breaks the page.

    Any ideas? Thks

  4. KrissieV
    Member
    Posted 11 months ago #

    just a syntax issue, should be:

    <?php wp_list_pages( 'title_li=&exclude=PostNo' ); ?>

    assuming you are changing PostNo to the actual number of the post... you can do multiple posts/pages, by separating them with a comma, so it would look like this:

    <?php wp_list_pages( 'title_li=&exclude=38,56,78' ); ?>

  5. Waup
    Member
    Posted 11 months ago #

    Perfect, solved. Thks KrissieV

Reply

You must log in to post.

About this Topic