baszer
Member
Posted 6 months ago #
Hello,
I want to display all my custom post types in the menu. When I did this no one was listed. I had to add the following code to my function.php
//To make category archives display all posts, regardless of post type
function any_ptype_on_cat($request) {
if ( isset($request['category_name']) )
$request['post_type'] = 'any';
return $request;
}
add_filter('request', 'any_ptype_on_cat');
Now the custom post type was listed. I now created a category-customposttype.php and got them listed. But only the first ten are listed. I want to add the following line of code <?php query_posts( 'posts_per_page=-1' ); ?> and nothing is listed anymore. I think it is because WP doesnt see them as the same content. But how can I make it so that I can list them on my way?
http://wordpress.org/extend/plugins/custom-post-type-ui/
Ov3rfly
Member
Posted 6 months ago #
You should get more entries by increasing the "... show at most" number in "WordPress Settings Reading Screen"
http://codex.wordpress.org/Settings_Reading_Screen
baszer
Member
Posted 6 months ago #
yes I know that, but I only want to change the amount of posts on this template. Not on my other pages.
Ov3rfly
Member
Posted 6 months ago #
Can you post the relevant code from your category-customposttype.php?
baszer
Member
Posted 6 months ago #
baszer
Member
Posted 6 months ago #
@over3fly, i got it working now! Deleted the
//To make category archives display all posts, regardless of post type
function any_ptype_on_cat($request) {
if ( isset($request['category_name']) )
$request['post_type'] = 'any';
return $request;
}
add_filter('request', 'any_ptype_on_cat');
and added query_posts( 'post_type=correct_type'); Thanks for answering me!
Ov3rfly
Member
Posted 6 months ago #