I’m encountering the same issue. Boss is pissed.
fixed by adding this to functions.php
just change “CUSTOM POST TYPE HERE” with your post type. example: post, events, or gallery
function my_query_for_homepage( $query ) {
if( $query->is_main_query() && $query->is_home() ) {
$query->set( ‘post_type’, array( ‘CUSTOM POST TYPE HERE’ ) );
}
}
add_action( ‘pre_get_posts’, ‘my_query_for_homepage’ );
Hi, Same here for the category pages I am getting error. I shifted from Blogger to WordPress and did 301 redirect for the posts and all but now the category pages are giving 404. So in custom post type what exactly I should put for my categories to work. I am not so good in coding so can you please help. Here is my Blog at: http://www.thenewipadblog.net
Just go to the URL and click on any category link you will understand.
Can someone please help.
I’ve tried the above solution and it will not work for me.
within my functions.php file:
function my_query_for_homepage( $query ) {
if( $query->is_main_query() && $query->is_home() ) {
$query->set( ‘post_type’, array( ‘CUSTOM POST TYPE HERE’ ) );
}
}
add_action( ‘pre_get_posts’, ‘my_query_for_homepage’ );
I’ve also tried items from this page:
http://wordpress.org/support/topic/after-wp-34-upgrade-the-pagination-setup-not-working-anymore
The moment a browser tried to go to the second page, I get a 404 error.
http://orthoworxindiana.com/enewsletter-articles/2011/10/
Thanks for your help.