Forum Replies Created
-
AuthorPosts
-
Genesis Developer
MemberOk. remove the above function and use this code
add_action( 'pre_get_posts', 'only_blog_post' ); function only_blog_post( $query ) { if( $query->is_search ) { $query->set( 'post_type', array('post') ); } }
Genesis Developer
Membersorry! typo mistake
use this
add_action( ‘pre_get_posts’, ‘custom_post_limit’ );
function custom_post_limit( $query ) {if( $query->is_search && (get_post_type() == ‘post’) ) {
$query->set( ‘posts_per_page’, ‘PUT YOUR LIMIT HERE’ );
}}
Genesis Developer
MemberTry this
add_action( 'pre_get_posts', 'custom_post_limit' );
function custom_post_limit( $query ) {if( $query->is_serach && (get_post_type() == 'post') ) {
$query->set( 'posts_per_page', 'PUT YOUR LIMIT HERE' );
}}
Genesis Developer
MemberCheck the "show post meta" checkbox. Then category list will display on front page
-
AuthorPosts