WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Pages in Topics List (4 posts)

  1. thebindlestick
    Member
    Posted 7 years ago #

    When I add a new page (manage -> pages) it shows up in my list of pages in my left column, and also in my list of the 10 most recent posts on the right column. Is this supposed to happen in WordPress? Maybe I am misunderstanding what Pages are. Here's my right column code where I do not want the pages to show up:

    <h1><?php _e("Recent Posts"); ?></h1>
    
    <ul>
    <?php
    
    foreach ($recentposts as $post) {
    
    if ($post->post_title == '')
    
    $post->post_title = sprintf(__('Post #%s'), $post->ID);
    
    echo "
    <li><a>ID)."'>";
    
    the_title();
    
    echo '</a></li>
    ';
    
    }
    
    ?>
    
    </ul>
    <?php endif; ?>
    
    	<?php endif; ?>		
    
    <br><br>
    <div class="subnav">
    <?php if ( !function_exists('dynamic_sidebar')
            || !dynamic_sidebar(1) ) : ?>
    
    		<?php if (function_exists('wp_theme_switcher')) { ?>
    
    <h1>Themes</h1>
    
    <?php wp_theme_switcher('dropdown'); ?>
    
    <?php } ?>
    </div>
    
    		<h1><?php _e('Archives');?></h1>
    <br>
    
    <ul>
    <li>
    <?php wp_get_archives('type=monthly'); ?>
    </li>
    </ul>
    <?php endif; ?>
    	</div>
  2. Andrew Ozz
    WordPress Dev
    Posted 7 years ago #

    Perhaps use "get_posts()". You can customize it a lot...
    http://codex.wordpress.org/Template_Tags/get_posts

  3. rudolf45
    Member
    Posted 7 years ago #

  4. thebindlestick
    Member
    Posted 7 years ago #

    Rudolf, that worked thank you.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags