• Hello,

    How can I create a function that checks the post category and base on the that show the latest post on that category or if possible check multiple categories?

    Thanks,

Viewing 2 replies - 1 through 2 (of 2 total)
  • hi wppit,

    Sorry, I have tried to get but did not clear your requirement. ??

    Can you please explain more your problem.

    My guess: You want to show latest post of each category- right?

    If yes then,

    Answer: WP provides function to get all the categories in a array, then in foreach loop for categories you can get the post list by using function query_posts using parameters category id, order by post publish date and showpost parameter value to 1.

    Then print the data as you required ??

    Thanks

    Thread Starter wpmhweb

    (@wppit)

    Hello manishkrag,

    This is what I need: When a visitor loads a new post, I would like WordPress to check the category of the post the visitor just loaded. Then depending in which category that post is, I would like to show the latest post for that particular category.

    Thanks,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to check post category and display latest post?’ is closed to new replies.