WordPress.org

Ready to get started?Download WordPress

Forums

Types - Custom Fields and Custom Post Types Management
Custom posts show up in blog (3 posts)

  1. mgrant
    Member
    Posted 2 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.

    http://wordpress.org/extend/plugins/types/

  2. AmirHelzer
    Member
    Plugin Author

    Posted 2 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
    Member
    Posted 2 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

About this Topic

Tags