Support » Themes and Templates » Creating 'Featured posts' with loop and custom post type

  • Resolved RETALI8


    I know to a degree this is covered in the codec under #multiple_loops, but I am wondering if anybody can recommend the best/most efficient way to achieve the following.

    I want to have the ‘home‘ page displaying a loop which ONLY displays post types that are marked as Featured (through I imagine either a custom post type or category?).

    The loop on the ‘blog‘ section of the page will contain all blog posts, including those marked as ‘featured.

    I also don’t want the slug for the permalinks of featured posts to be ‘featured’ but fall under whatever category will be appropriate for the post.


Viewing 1 replies (of 1 total)
  • I ended up using

    <?php query_posts('category_name=featured&posts_per_page=3'); //only display featured posts

    In the loop on the homepage.
    By categorising a post as ‘featured’ it will display in the loop on the homepage as well as well as in the feed of the regular ‘blog’ section. To avoid the slug of the permalink being marked featured, I assign the category of ‘featured’ after choosing the category it should appear in.

    Not sure if it’s necessarily the most elegant solution, however It works for the purpose of this particular theme.

Viewing 1 replies (of 1 total)
  • The topic ‘Creating 'Featured posts' with loop and custom post type’ is closed to new replies.