Support » Fixing WordPress » How to list down published posts in a column

  • Hi,
    I want to create a navigation menu which will list all the articles that i have published. I know that i can do this using the recent post widget but it a) lists the latest article first and b) it allows only recent 15 posts. What i want to do is something like this http://www.echemotherapy.com/. How can i do this?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Could put this in your sidebar or a php code widget:

    <?php
        $args=array(
          'showposts'=>-1,
          'orderby' => 'title',
          'order' => 'ASC',
          'caller_get_posts'=>1
        );
        $my_query = new WP_Query($args);
        if( $my_query->have_posts() ) {
          echo 'All my posts';
          while ($my_query->have_posts()) : $my_query->the_post(); ?>
            <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
           <?php
          endwhile;
        } //if ($my_query)
      wp_reset_query();  // Restore global post data stomped by the_post().
    ?>

    Here’s another approach using get_posts.

    <ul>
    <?php
    global $post;
    $myposts = get_posts('showposts=100');//set max value here
    foreach($myposts as $post) :
    ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
    </ul>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to list down published posts in a column’ is closed to new replies.