Solved

Can't get Custom Post Type to display after select with Drop Down List

Posted on 2010-08-24
2
299 Views
Last Modified: 2012-05-10
I have created a custom post type, and it works ok.  I can go to the edit screen and click on 'View' and it properly uses the correct template to show the single custom post type.

I then have a page with the following code:
<form action="<?php bloginfo('url'); ?>" method="get">
        <div>
		<?php wp_dropdown_categories(array('taxonomy' => 'Membership Category')); ?>
        <input type="submit" name="submit" value ="view" />
        </div>
        </form>

Open in new window


When you select a term from the drop down list, I get a Error 404 page not found.  This is the link that it is trying to show:
webste/wp-development/?cat=16&submit=view

It seems like the permalinks/redirect is not working properly.

In my custom post type setup, I have this:
function memberlist_register() {
 
	$labels = array(
		'name' => _x('Member List', 'post type general name'),
		'singular_name' => _x('Member List', 'post type singular name'),
		'add_new' => _x('Add New', 'member list'),
		'add_new_item' => __('Add New Member'),
		'edit_item' => __('Edit Memeber'),
		'new_item' => __('New Member'),
		'view_item' => __('View Member'),
		'search_items' => __('Search Member'),
		'not_found' =>  __('Nothing found'),
		'not_found_in_trash' => __('Nothing found in Trash'),
		'parent_item_colon' => ''
	);
 
	$args = array(
		'labels' => $labels,
		'public' => true,
		'publicly_queryable' => true,
		'show_ui' => true,
		'_builtin' => false,
		'query_var' => true,
		'menu_icon' => get_stylesheet_directory_uri() . '/article16.png',
		'capability_type' => 'post',
		'hierarchical' => true,
		'rewrite' => array ('slug' => 'memberlists'),
		'menu_position' => null,
		'supports' => array('title','thumbnail')
	  ); 
 
	register_post_type( 'memberlist' , $args );
}

Open in new window


I have went to the permalinks in setup and re-saved everything to flush the permalinks.

0
Comment
Question by:keith1001
2 Comments
 
LVL 23

Expert Comment

by:jeremyjared74
Comment Utility
I know this is kind of a "hack fix", but have you attempted to download simple 301 redirects plugin: http://wordpress.org/extend/plugins/simple-301-redirects/

Then in the 301 redirect settings you would put:
webste/wp-development/?cat=16&submit=view

And in the second URL box of the 301 Redirect Settings page you would put:
webste/wp-development/"whatever the category is you are tying to link to"

Let me know  if this helps.
0
 

Accepted Solution

by:
keith1001 earned 0 total points
Comment Utility
What I had to end up doing was create my own function for the drop down list.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now