1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to exclude pages in Wordpress from PHP recent posts list (mdv_recent_posts)?

Discussion in 'PHP' started by Pixelrage, Jul 7, 2010.

  1. #1
    I'm trying to make this PHP code work as usual, except I want it to stop displaying the pages that have the IDs "2" and "32" in the outputted list. How would I do it? Searched Google endlessly and can't find an answer :(

    <h1>Recent articles</h1>
    
    <ul class="recent">
    <?php mdv_recent_posts(10); ?>
    </ul>
    Code (markup):

     
    Pixelrage, Jul 7, 2010 IP
  2. lukeg32

    lukeg32 Peon

    Messages:
    645
    Likes Received:
    19
    Best Answers:
    1
    Trophy Points:
    0
    #2
    looking at the (limited) documentation of that plugin, it doesnt look like its capable of doing it.

    Get a different lpugin that is capable of doing it, or do away with it all together and use the get_posts function

    http://codex.wordpress.org/Template_Tags/get_posts

    (see "exclude" in the docs)
     
    lukeg32, Jul 8, 2010 IP
    Pixelrage likes this.
  3. Pixelrage

    Pixelrage Peon

    Messages:
    5,083
    Likes Received:
    128
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks Luke for that great recommendation.
     
    Pixelrage, Jul 8, 2010 IP