Support » Fixing WordPress » Mini-loop adding pages

  • Resolved leanda



    I’ve set up a static page which uses a mini-loop to pull in recent posts into a sidebar.

    Here’s the code:

    $news=$wpdb->get_results(“SELECT ID, post_title, post_excerpt FROM $wpdb->posts
    WHERE post_status=’publish’ ORDER BY ID DESC LIMIT $how_many”);
    foreach($news as $np){
    echo ‘

    If I add a new page it also brings in the page by ID and puts a link in the middle of my recent posts list. Is there any way to stop it from doing this?

    This is the first time I’ve used PHP so I’m really struggling.


Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Mini-loop adding pages’ is closed to new replies.