Custom posts show up in blog (3 posts)

  1. mgrant
    Posted 3 years ago #

    Is there some way to stop my custom post types from showing up in my blog (most recent posts)? For example, so that the custom posts types are treated more like pages instead of posts.


  2. Amir Helzer
    Plugin Author

    Posted 3 years ago #

    This really depends on how your theme queries the 'recent posts'. If you can explain that here, I'm sure that we can find how to list only 'post' types.

  3. mgrant
    Posted 3 years ago #

    Yes, I just discovered this too, I hadn't realized it was theme dependent.

    I discovered that if I create a page called 'Blog' and set the Post Page (under Settings->Reading) to this page, then I set the template to something other than the default template (for example the theme I'm using has a template called Blog which has a corresponding blog.php in the theme folder. I simply modified it specifically ask for posts of type 'post' this:

    $blog_query = array(
    		'paged' => get_query_var('paged'),
    		'post_type' => 'post'  // <-- I added this line
    $posts = &query_posts($blog_query);

    But I am left with a question for my complete understanding of this... If I left the template to the default template, which file or function in my theme is being used to do the query?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Types
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic