Forums

Category if sticky else latest (1 post)

  1. alan_baxter
    Member
    Posted 7 months ago #

    I've been trying to write a script that shows the latest (single) post (in a particular category), however, if the user has chosen to have a post be sticky then the sticky post shows. When the sticky post is removed the latest post is then shown.

    The trouble I've been having is trying to is using WordPress build in methods to do:

    Loop through all the 'News' categories
    - if: one of the posts is sticky, echo it out
    - else: echo out the latest post

    Hope someone can help guide me.

Reply

You must log in to post.

About this Topic