WordPress.org

Support

Support » How-To and Troubleshooting » want to see my posts in the sidebar?

want to see my posts in the sidebar?

  • I would like to see a list of my post’s in the sidebar of the template I am using.

    I searched the forums and found a few topics relating to this, the most specific one suggested editing the below code into the sidebar.php template.

    I did that and nothing happened, no errors and no change to my side bar.

    I would appreciate any guidance on how to get my posts to show up in the sidebar and or on the code I have attached below.

    Thanks very much.

    Henry

    <?php require(“/var/www/html/blog/wp-blog-header.php”); ?>

  • <!– Activity –>
      <h1><?php _e(‘Activity’); ?></h1>
      <!–This will show the last 10 posts, including the last one. To change the number of post shown
      edit the ‘nuberposts=x’ to whatever value you want, and to skip the last one (or last 2, 3, etc.)
      increase the value of ‘offset=x’ (default is “0” so it will start by the last post)–>
      <?php
      $posts = get_posts(‘numberposts=10&offset=0’);
      foreach ($posts as $post) :
      ?>

    • ” title=”<?php the_title() ?>”><?php the_title() ?>
    • <?php
      endforeach;
      ?>

  • <!– End of Activity –>

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘want to see my posts in the sidebar?’ is closed to new replies.
Skip to toolbar