WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Type UI
[resolved] Categories and lists (7 posts)

  1. baszer
    Member
    Posted 2 years 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/

  2. Ov3rfly
    Member
    Posted 2 years 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

  3. baszer
    Member
    Posted 2 years ago #

    yes I know that, but I only want to change the amount of posts on this template. Not on my other pages.

  4. Ov3rfly
    Member
    Posted 2 years ago #

    Can you post the relevant code from your category-customposttype.php?

  5. baszer
    Member
    Posted 2 years ago #

  6. baszer
    Member
    Posted 2 years 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!

  7. Ov3rfly
    Member
    Posted 2 years ago #

    Ok. No problem...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic