Home Forums Plugin Support WP User Frontend Pro viewing the single post gives me a 404 page

This topic is: resolved

This topic contains 3 replies, has 2 voices, and was last updated by  towhid 3 years, 10 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #45564

    RJ
    Participant
    Post count: 21

    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 );
    #45684

    towhid
    Participant
    Post count: 4505

    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

    #46016

    RJ
    Participant
    Post count: 21

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

    #46104

    towhid
    Participant
    Post count: 4505

    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 4 posts - 1 through 4 (of 4 total)

The topic ‘viewing the single post gives me a 404 page’ is closed to new replies.