• I am setting up a site for a friend, it is https://www.realdy.com

    It has custom post types that I have set up the user roles to be be such that only a certain level user can post a “property” listing.

    Is there a way to embed this custom post type into a page so that these users can make a post from a page rather than click “add new “post””

    Thank You

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter CostaKapo

    (@costakapo)

    Moderator bcworkz

    (@bcworkz)

    I’m not sure what you would gain, the new post admin screen is essentially a page. You’d just be replicating what’s already available. You’d have to click something to get to your custom page, why not click on “Add New” to get to the admin screen? You could even add the link somewhere in the front end if you wanted to. wp-admin/post-new.php?post_type=property

    But yes, it’s possible. The admin screen is basically an elaborate HTML form. Yours would be too. When the form is submitted, the form data is assembled into an array suitable for using with wp_insert_post(). Be sure you validate and sanitize all the data before inserting the post!

    The code page could be added to the admin menu, or you could use it as a page template. Add a new page based on it, then use the assigned slug to access the page much like you would for any other page.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Embed Custom Post Type Into a Page’ is closed to new replies.