Skip Navigation

[Closed] Limit number post without WordPress Archive

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 9 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 8 replies, has 2 voices.

Last updated by Luo Yang 9 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#247127

Hi all!
I want to Limit number post without WordPress Archive with wp-views. Help me !
Thanks !

#247377

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

#247705

Hi luoy !
I want to work with WordPress Archives: hidden link. I want to Limit number post without WordPress Archive with wp-views.
Thanks !

#247710
Edit WordPress Archive ‹ Duong Ha Seafood — WordPress.png

Or you cant click see image: hidden link

#247721

Please try setup the limit option in wordpress Settings-> Reading
the option:
Blog pages show at most
hidden link

see the result:
hidden link

#247980

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 !

#249137

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

#249387

Thanks luoy !
But I can't be done.

#249624

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

The topic ‘[Closed] Limit number post without WordPress Archive’ is closed to new replies.