• narola

    (@narola)


    Hello Support,

    Ultimate Member plug-in looks great plug-in with many features.

    I need to customize member’s profile Posts tab. Currently it’s showing posts with default post type. In my site, 3 custom post types are there. So I want to show all the posts from these 3 custom post types. I checked the posts.php template file of the plugin. there is one line of code:

    <?php $query_posts = $ultimatemember->query->make(‘post_type=post&posts_per_page=10&offset=0&author=’ . um_user(‘ID’) ); ?>

    I see I can replace this with my custom post type : ‘post_type=post’ . BUT, this will be for only one custom post type. I have 3 custom post types in my site. So how can I do that?

    Could you please let us know if there is any quick solution to this?

    Looking forward to your reply!

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @narola,

    It is using the standard WP_Query. You can use the filter hook in the link to modify the query:

    https://codex.www.ads-software.com/Plugin_API/Action_Reference/pre_get_posts

    Thanks.

    Thread Starter narola

    (@narola)

    Thanks for your reply.

    Actually, I already tried pre_get_posts solution but it’s not working with the plug-in query. When I checked the $query object, it takes “post” as default post_type in queried object.

    I implemented following solution to show the custom post type post in the posts.php template :

    <?php $query_posts = $ultimatemember->query->make(‘post_type[]=event&post_type[]=sale&post_type[]=offer&posts_per_page=100&offset=0&author=’ . um_user(‘ID’) ); ?>

    It’s working great. BUT, in this, there is one issue when user clicks on [LOAD MORE] button.

    Below is the [LOAD MORE] button link HTML:

    <a href="#" class="um-ajax-paginate um-button" data-hook="um_load_posts" data-args="<strong>post</strong>,10,10,<?php echo um_user('ID'); ?>"><?php _e('load more posts','ultimatemember'); ?></a>

    Now as per the doc, I need to change “post” posttype with my custom post types (‘event’, ‘sale’, ‘offer’) in the “data-args” attribute.

    So how can I do this to show custom posts on [LOAD MORE]?

    Looking forward to your reply!

    Thanks.

    • This reply was modified 8 years ago by narola.
    • This reply was modified 8 years ago by narola.
    • This reply was modified 8 years ago by narola.
    Plugin Support Ultimate Member Support

    (@ultimatemembersupport)

    Hi @narola,

    Have you tried creating a new profile tab to list custom posts with pagination?

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to show posts with custom post types on profile post tab’ is closed to new replies.