• Hi,

    I am using the coffee2code plugin https://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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Scott Reilly

    (@coffee2code)

    WordPress & Plugin Developer

    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:
    https://coffee2code.com/wp-plugins/customizable-post-listings

    Thread Starter shafee85

    (@shafee85)

    Yes, it works! thanks a load coffee2code ??

    Thread Starter shafee85

    (@shafee85)

    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

    Thread Starter shafee85

    (@shafee85)

    Any help please?

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

    Space-separated list of category IDs

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Exclude few recent posts from the recent post list (coffee2code)’ is closed to new replies.