Wordpress Pros! Need some advice ASAP!!

Discussion in 'WordPress' started by dencha, Oct 15, 2007.

  1. #1
    I'm about to launch a blog but need some help to tweak a small section of the blog.

    Problem:
    I have a recent post section on my sidebar, I want to omit a certain category post from being included as a "recent post", not sure how to do that.

    I don't know php that much, so will need some advice....please IM on AIM @

    d3ncha

    Thanks
     
    dencha, Oct 15, 2007 IP
  2. local-realtor

    local-realtor Guest

    Messages:
    140
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You should be able to exclude that category ID from the recent posts call. I am not sure how you have it set up (plugin/widget) but you can add in a parameter to exclude cat ID=XX.

    Are you using a plugin?
     
    local-realtor, Oct 15, 2007 IP
  3. dencha

    dencha Active Member

    Messages:
    501
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    78
    #3
    no im not using a plugin for the "recent comments" in the sidebar, let me take a look at excluding the cat id from there.

    Could this also be done on the main template? don't what a certain cat post to show up there also...
     
    dencha, Oct 15, 2007 IP
  4. dencha

    dencha Active Member

    Messages:
    501
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    78
    #4
    what is the php code to exclude a certain cat id?

    I believe this is the php that calls for the recent post section (correct me if I'm wrong)
    <?php
    }
    
    function widget_recent_entries($args) {
    	extract($args);
    	$title = __('Recent Posts', 'widgets');
    	$r = new WP_Query('showposts=10');
    	if ($r->have_posts()) :
    ?>
    PHP:
     
    dencha, Oct 15, 2007 IP
  5. local-realtor

    local-realtor Guest

    Messages:
    140
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Try this:

    <?php
    }
    
    function widget_recent_entries($args) {
        extract($args);
        $title = __('Recent Posts', 'widgets');
        $r = new WP_Query('showposts=10&exclude=[COLOR="Red"]XX[/COLOR]');
        if ($r->have_posts()) :
    ?>
    Code (markup):
    Where XX is the category ID you want to exclude. Disclaimer- I am not an expert but I think this may work.
     
    local-realtor, Oct 15, 2007 IP
  6. dencha

    dencha Active Member

    Messages:
    501
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    78
    #6
    nope that didn't work
     
    dencha, Oct 15, 2007 IP
  7. dencha

    dencha Active Member

    Messages:
    501
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    78
    #7
    problem solved....thanks anyway
     
    dencha, Oct 15, 2007 IP