Skip Navigation

[Resolved] Displaying user's CPT excerpts on their profile page

This support ticket is created 6 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 4 replies, has 2 voices.

Last updated by Nigel 6 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#628173

Tell us what you are trying to do?

I'm trying to display metadata from CPTs created by a user on their profile page. I can technically do it exclusively from a PHP file, but it is hard to work with from a formatting perspective. No amount of front-end css makes it look as good as I could do in Views.

Ultimate Member is my profile page plugin, and they have the admin as the child page's author, so I can't easily use the "posts with the same author as the page" View filter in Toolset. I've spent many, many hours trying to figure this out. There are a few similar threads already on here, but none worked for me.

I can display a View, no problem. It's having it filtered by the user that's the problem. I was thinking the new relationship feature would be the answer. It wasn't. thanks

#628283

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Daniel

I'm not familiar with Ultimate Member, but if you can clarify what's involved I should be able to help.

This is the bit I don't follow: " and they have the admin as the child page's author".

With Ultimate Member users have a profile page. Is this a static WordPress page which Ultimate Member populates with content about the user? Is the user id set somewhere (e.g. a URL parameter)?

Or is there a unique URL with the username, e.g. site.com/dashboard/john-smith, and that's what you mean by child page?

I need to know how we identify the user to recommend how to set up the Views filter.

#628300

Thanks for the reply-

I'd say...it is both actually. UM's profile page is a static page (of your choice), where child pages are then created for each new user. You plug in the profile shortcode, and that's that. I'm 99 percent sure it is still tied to the user ID. But, I'm listed as the child page's author, not the user. So I am unable to use the Toolset author View filter by page/post author. Because everyone's profile would just display my posts, and no one would enjoy that.

But yes, they have unique IDs, for example, http://www.wp-types.com/user/nigel with hidden link being the page and /nigel being the chid page.

Below are a couple of snippets from their single-post.php and post.php files, which might help answer your questions.

<?php while ($ultimatemember->shortcodes->loop->have_posts()) { $ultimatemember->shortcodes->loop->the_post(); $post_id = get_the_ID(); ?>

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

#628643

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Where are you trying to add the View?

If each user has their own static page and they are the author of that page then you could insert a View on that page and use the "posts with the same author as the page" filter.

But you surely wouldn't want to edit each page and insert a View on it.

I'd suggest you create a Content Template for these pages and insert your View into that template, where, again, you should be able to use that filter, but assigning the template to all of those pages but not other pages on your site may be cumbersome.

I think it would help if I could see if myself, if that's okay?

I will mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for me to use that you can later delete. And be sure to have a current backup of your site, even though I don't intend to make any changes.

#628815

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Closing this per your comments in the other thread.