I want to make selecting a featured post is just by checking a checkbox in edit screen AND be able to retrieve these featured articles from only specific category ?
in short what I’m looking for :
-
set featured post
-
loop throw featured posts in a specific category (not all posts)
Any help? and thanks in advance 🙂
You can do this by following these steps:
Place this in your themes functions.php file:
Then in your template file use the following for the main loop:
FOR EXAMPLE PURPOSES ONLY: For custom loops (If running multiple loops on one page), you would use this:
I tried to run this code and it helps me a lot for displaying my featured post on my homepage for my case study custom post type. Thanks a lot.