Front end submission form not displaying CPTs
- This topic has 16 replies, 2 voices, and was last updated 3 weeks, 2 days ago by
Peter.
-
AuthorPosts
-
March 18, 2025 at 5:31 AM #47843
Tanja Kropf
ParticipantI'm having the same issue this person did: https://support.metabox.io/topic/user-dashboard-displays-regular-posts/
I use the ProfileGrid plugin, where I've added the user dashboard shortcode to display a user's posts. It's only showing blog posts and not CPTs, when I need it to show CPTs.
March 18, 2025 at 9:25 PM #47852Peter
ModeratorHello Tanja,
Please add the attribute
post_type
to the frontend dashboard shortcode to show the CPT posts. For example:[mb_frontend_dashboard edit_page="124" post_type="cpt-slug-here"]
Let me know how it goes.
March 18, 2025 at 10:28 PM #47854Tanja Kropf
ParticipantThank you. I'll give that a shot. What is this in reference to, though? edit_page="124" Not sure what I should replace that with.
March 19, 2025 at 1:59 AM #47858Tanja Kropf
ParticipantOne other question, what if I have multiple CPTs?
March 19, 2025 at 2:11 AM #47859Tanja Kropf
ParticipantThis is what I put in (I figured out the page ID for the page the shortcode is on).
[mb_frontend_dashboard edit_page="30855" object_type="directory"]
And I get an error that says "Model name is required"
<div class="rwmb-error">Model name is required</div>
March 20, 2025 at 9:27 PM #47870Tanja Kropf
ParticipantFollowing up on this...
March 20, 2025 at 9:59 PM #47871Tanja Kropf
ParticipantI also tried creating a test edit page with the user dashboard in Bricks, and it will show on the backend, but not the front. But if I try to add the regular shortcode on that same page: [mb_frontend_dashboard edit_page="124"], it says the content is empty. It is not.
Also, can you include multiple CPTs? It seems with the Bricks element you are limited to one.
March 20, 2025 at 10:15 PM #47872Peter
ModeratorHello,
Sorry, the attribute for the post type should be
post_type
[mb_frontend_dashboard edit_page="30855" post_type="directory" object_type="post"]
Following the documentation https://docs.metabox.io/extensions/mb-frontend-submission/#user-dashboard
March 21, 2025 at 11:02 PM #47890Tanja Kropf
ParticipantThank you Peter. That worked. Can I include two different CPTs, though? And also, can I cap it to show only X number of listings? I ask because I have a directory and under my own dashboard, there are 4000 listings and it's causing loading issues. Thank you!
March 23, 2025 at 2:30 AM #47897Tanja Kropf
ParticipantHi,
I'm still waiting to hear back on including multiple CPTs on the dashboard. I also was able to create some code to limit the amount of listings that load at once, but is there some way to create pagination??
March 23, 2025 at 6:43 AM #47898Tanja Kropf
ParticipantI'm also getting confused by the edit post function. If I have a front end submission form that's different for each CPT, then I'd have two different edit pages? The documentation is really unclear and this is not intuitive.
Thanks.
March 23, 2025 at 6:06 PM #47900Peter
ModeratorHello,
Can I include two different CPTs, though?
No, it shouldn't be. You should add one post type to a frontend form per page and have one dashboard/edit page per post type.
March 23, 2025 at 9:20 PM #47901Tanja Kropf
ParticipantThanks Peter---still waiting on answers for my other questions regarding A) adding pagination or B) limiting the number of posts that load on the dashboard. Thanks.
March 23, 2025 at 10:02 PM #47903Peter
ModeratorHello,
There isn't an option to add the pagination to the dashboard. If you want to limit the number of posts on the dashboard, you can use the filter hook
rwmb_frontend_dashboard_query_args
to modify the query argumentposts_per_page
. For example:add_filter( 'rwmb_frontend_dashboard_query_args', function( $args ) { $args['posts_per_page'] = 15; // show 15 posts return $args; } );
Following the documentation https://docs.metabox.io/extensions/mb-frontend-submission/#dashboard
March 23, 2025 at 10:43 PM #47904Tanja Kropf
ParticipantAm I missing something? I've added this to Scripts Organizer and it's still returning all posts:
<?php
add_filter( 'rwmb_frontend_dashboard_query_args', function( $args ) {
$args['posts_per_page'] = 30; // show 30 postsreturn $args;
} );
?> -
AuthorPosts
- You must be logged in to reply to this topic.