Forums

Exclude few recent posts from the recent post list (coffee2code) (6 posts)

  1. shafee85
    Member
    Posted 1 month ago #

    Hi,

    I am using the coffee2code plugin http://coffee2code.com/archives/2004/08/27/plugin-customizable-post-listings/ to display my recent post on the sidebar.

    I have used the following code to display the recent post.

    <?php c2c_get_recent_posts(5, "<li>%post_URL%<br /></li>", "50"); ?>

    It works great, but there is a small issue. Now my category displays 10 blog posts per page and i dont want to see the same blog posts be repeated on the sidebar too. Is there a way to exclude the top 10 most latest recent posts to the above code? Would appreciate any help.

    Thank you for reading.

  2. coffee2code
    Member
    Posted 4 weeks ago #

    Hi shafee85:

    The $offset argument to the various functions allows you to skip any number of posts from the top of the listing. So to exclude the 10 most recent from the listing, use this:

    <?php c2c_get_recent_posts(5, "<li>%post_URL%<br /></li>", "50", "date", "DESC", 10); ?>

    Also, do note that the current URL for the plugin is:
    http://coffee2code.com/wp-plugins/customizable-post-listings

  3. shafee85
    Member
    Posted 3 weeks ago #

    Yes, it works! thanks a load coffee2code :)

  4. shafee85
    Member
    Posted 2 weeks ago #

    Re-opening this solved issue due to recent discovery.

    <?php c2c_get_recent_posts(5, "<li>%post_URL%<br /></li>", "50", "date", "DESC", 10); ?>

    The above mentioned category id 50 is a parent. Is there a way i can get the recent posts of all its child categories as well? the above code does not display posts of the children.

    Please help.

    Thank you

  5. shafee85
    Member
    Posted 2 weeks ago #

    Any help please?

  6. MichaelH
    moderator
    Posted 2 weeks ago #

    Might have to list each of those categories as described by Scott:

    Space-separated list of category IDs

Reply

You must log in to post.

About this Topic