Hi all!
I want to Limit number post without WordPress Archive with wp-views. Help me !
Thanks !
Hi thip,
It is possible within Views, see the demo site:
hidden link
user/pass: xgren/111111
in section "Limit and offset", there is an option to set the limit number: Display n items
See the result page:
hidden link
Hi luoy !
I want to work with WordPress Archives: hidden link. I want to Limit number post without WordPress Archive with wp-views.
Thanks !
Or you cant click see image: hidden link
Please try setup the limit option in wordpress Settings-> Reading
the option:
Blog pages show at most
hidden link
see the result:
hidden link
Hi Luoy !
If settup in WP Setting -> Reading then Ok, But with categories device affect.
I want WP Archive don't device affect with Categories the limit option
Thanks !
It is not possible within Views, please try wordpress filter hook pre_get_posts, like this:
add codes in your theme/functions.php:
function some_func( $query ){
if ( $query->is_post_type_archive('cpt1') && $query->is_main_query()) {
$query->set('posts_per_page', 3);
}
return $query;
}
add_action('pre_get_posts','some_func');
Please replace cpt1 with your custom post type slug,
replace 3 with your post per page you needed.
More help:
http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts
Thanks luoy !
But I can't be done.
Could you duplicate same problem in a test site and fill below private detail box with the login details, I need a live website to test and debug the PHP codes