viewing the single post gives me a 404 page

This topic contains 3 reply and 2 voices, and was last updated by towhid 8 years, 10 months ago
Viewing 3 Posts - 1 through 3 (of 3 total)
Author Posts
May 29, 2015 at 12:39 am 45564
towhid I've created a custom post type - listings - for a real estate website and I've created a form through WP Frontend that corresponds with this post type. The post type for the form is set as "listings" and the post status is set as "published". The problem is that even though I see the submitted post in the backend and I see it on the posts page (where all the excerpts are shown), I can't see the individual single post. If I try to go to it, it says page not found 404. I've used this plugin on other forms and custom post types with great success, so I'm not sure what I'm missing here since I'm not really doing anything different. Please help! Thank you! In case this matters - this is how I've set up my custom post type in my custom.php file:
// Property Custom Post Type
function cpt_listings() {

	$labels = array(
		'name'                => 'Listings',
		'singular_name'       => 'Listing',
		'menu_name'           => 'Listing',
		'parent_item_colon'   => 'Parent Listing:',
		'all_items'           => 'All Listings',
		'view_item'           => 'View Listing',
		'add_new_item'        => 'Add New Listing',
		'add_new'             => 'Add New',
		'edit_item'           => 'Edit Listing',
		'update_item'         => 'Update Listing',
		'search_items'        => 'Search Listings',
		'not_found'           => 'Not found',
		'not_found_in_trash'  => 'Not found in Trash',
	);
	$args = array(
		'label'               => 'listings',
		'description'         => 'Your listings in custom post format',
		'labels'              => $labels,
		'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ),
		'taxonomies'          => array( 'category', 'post_tag' ),
		'hierarchical'        => false,
		'public'              => true,
		'show_ui'             => true,
		'show_in_menu'        => true,
		'show_in_nav_menus'   => true,
		'show_in_admin_bar'   => true,
		'menu_position'       => 5,
		'can_export'          => true,
		'has_archive'         => true,
		'exclude_from_search' => false,
		'publicly_queryable'  => true,
		'capability_type'     => 'post',
	);
	register_post_type( 'listings', $args );

}

// Hook into the 'init' action
add_action( 'init', 'cpt_listings', 0 );
May 30, 2015 at 5:03 pm 45684
towhid towhid

Hello RJ,

I have reproduced this problem but did not get any inconsistency.

Please check below screenshot of backend after submitting the post:

Listing post

Here is the screenshot after submitting the listing form post.

Frontpage Listing

Thanks

June 3, 2015 at 3:46 am 46016
RJ RJ

Actually it turns out that I needed to update the permalinks, that is what was causing the problem. Thanks for your help!

June 4, 2015 at 3:11 pm 46104
towhid towhid

Hello RJ,

I am very happy to know that you have solved the problem. I am going to mark the topic resolved and closed.

Thanks

Viewing 3 Posts - 1 through 3 (of 3 total)