Front end submission form not displaying CPTs

Support General Front end submission form not displaying CPTs

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #47843
    Tanja KropfTanja Kropf
    Participant

    I'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.

    #47852
    PeterPeter
    Moderator

    Hello 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.

    #47854
    Tanja KropfTanja Kropf
    Participant

    Thank 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.

    #47858
    Tanja KropfTanja Kropf
    Participant

    One other question, what if I have multiple CPTs?

    #47859
    Tanja KropfTanja Kropf
    Participant

    This 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>

    #47870
    Tanja KropfTanja Kropf
    Participant

    Following up on this...

    #47871
    Tanja KropfTanja Kropf
    Participant

    I 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.

    #47872
    PeterPeter
    Moderator

    Hello,

    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

    #47890
    Tanja KropfTanja Kropf
    Participant

    Thank 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!

    #47897
    Tanja KropfTanja Kropf
    Participant

    Hi,

    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??

    #47898
    Tanja KropfTanja Kropf
    Participant

    I'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.

    #47900
    PeterPeter
    Moderator

    Hello,

    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.

    #47901
    Tanja KropfTanja Kropf
    Participant

    Thanks 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.

    #47903
    PeterPeter
    Moderator

    Hello,

    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 argument posts_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

    #47904
    Tanja KropfTanja Kropf
    Participant

    Am 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 posts

    return $args;
    } );
    ?>

Viewing 15 posts - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.