This is the P2PU Archive. If you want the current site, go to www.p2pu.org!

Wordpress Website 101    

My recent threads

You haven't posted any discussions yet.

Recently updated threads

custom post types

Go back to: General discussion

Hi Tomato and classmates,

I figured out how to make a custom post type and how to get it to display on my blog page along with my other posts. I added the recommended code in the functions.php. However, I would rather display it alone on a different page. Is there a way to alter the code on my functions.php to do that? This is the code I used:

add_filter( 'pre_get_posts', 'my_get_posts' );
function my_get_posts( $query ) {
               if ( is_home() && false == $query->query_vars['suppress_filters'] )
                             $query->set( 'post_type', array( 'post', 'blogstorm', 'attachment' ) );
               return $query;
}

My custom post is called blogstorm. The page I want it on is called News at http://purplefinch.org/news/
Is there an easy way to do this?

My site is purplefinch.org

Thanks.

Carmella