WordPress.org

Ready to get started?Download WordPress

Forums

WP User Frontend
[resolved] Custom post type not working (8 posts)

  1. Eckstein
    Member
    Posted 1 year ago #

    I have specified a custom post type for adding posts using: [wpuf_addpost post_type="tsv_userpost"]. However, when a user adds a new post, it is still using the "post" (default) post type instead of the custom post type.

    Anyone know why this might be happening and how I can fix it?

    http://wordpress.org/extend/plugins/wp-user-frontend/

  2. robbycornish
    Member
    Posted 1 year ago #

    I'm having kind of the same problem ... I changed my post type to "Publish" but will still default to "Pending"

    We need help!!

    Thanks.

  3. Eckstein
    Member
    Posted 1 year ago #

    Just to clarify, I'm talking about custom post types not the status of the post.

    Although Robby's issue seems to need attention to.

    Thanks.

  4. Eckstein
    Member
    Posted 1 year ago #

    So I deactivated the plugin in order to find a new solution and then reactivated it to show someone else the behavior I was talking about and... VOILA!... it fixed itself magically....

    So yeah, not sure what the issue was.

  5. ersaldivar
    Member
    Posted 1 year ago #

    Did that fix it indefinitely for you? I am going to try that and see if it works?

    Also, this may be a stupid question, but:

    How do you know what post_type value to place in? For example: yours is post_type="tsv_userpost" ?

    Thanks in advance for your help!

  6. Eckstein
    Member
    Posted 1 year ago #

    It did fix it for me, although I've switched to another plugin since then. The post type you put into it would depend on whatever your own custom post type is called.

    To create your own you can either use a plugin, like this one for instance: http://wordpress.org/extend/plugins/custom-post-type-ui/

    Or you can add something like this to your functions.php file:

    // Add A Custom Post Types
    
    add_action( 'init', 'create_post_type_YOURNAME' );//The name of the function is totally up to you
    function create_post_type_YOURNAME() {
    	register_post_type( 'your_post_type',//Again, the name is up to you
    		array(
    			'labels' => array(
    				'name' => __( 'your_post_type' ),
    				'singular_name' => __( 'your_post_type' )
    			),
    			'public' => true,
    			'has_archive' => true, //Creates archive page
    			'taxonomies' => array('category', 'post_tag'),//Allows categories and tags to be used with this post type
    			'show_in_menu' => true,//Show in the admin menu
    			'menu_position' => 5,//Position in the admin menu
    			'supports' => array('title', 'editor', 'thumbnail', 'comments'),//Choose what functions show up in the new post screen of your new post type
    		)
    	);
    }

    I would highly recommend the NON-plugin version. You can read more about the function's options here: http://codex.wordpress.org/Function_Reference/register_post_type

  7. ersaldivar
    Member
    Posted 1 year ago #

    Thanks, your reply helped me a bunch!

    Issue RESOLVED!

    -Ernest :)

  8. Eckstein
    Member
    Posted 1 year ago #

    Excellent, glad I could help!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic