sqkkyzx
Forum Replies Created
-
If these are of no use to you, I am sorry I can’t help you more. I’m not a developer and I don’t know how to build code. I just try to use the plugins I can find.
I also have some confusion. I have been trying my best to introduce you to my current plan. But since I am using translation software to communicate with you, I am not sure whether your needs and mine are really consistent. I just guess what you want to achieve by browsing the webpage you provided.
Now, I will show you in detail how to switch from the current solution to my implementation method, and can try it on the basis of “keep everything you have now” without deleting the added code and CSS, If you are willing to try, please follow Do the steps I provide, don’t think too much about why, and then check if it is what you want.
Make sure you use Elementor Pro!
Start now:
1. Create a new page, Named Test Members Page, Then close it without editing for now.
2. In Ultimate Member – Settings > General > page > Members page, Select the page Test Members Page you just created.
3. In Ultimate Member – Settings > appearance > profile menu > Enable profile menu, Disable this.
4. Add this code in the theme’s function.php:(Confirm that ‘post’ and ‘recipe’ in the code are the post types you need, if not, replace them)
add_action( ‘elementor/query/my_custom_filter_1’, function( $query ) {
global $current_user;
$query->set( ‘post_type’, [ ‘post’, ‘recipe’] );
$query->set( ‘author’, um_profile_id() );
} );5. Use Elementor to edit page Test User Page
6. On this page, add Shortcode Widget, Fill in [ultimatemember form_id=”7″](This should be replaced with the shortcode of your user configuration form)
7. On this page, add Posts Widget (Pro), Edit this widget in Content>Query>Query ID
Fill in my_custom_filter_1 in the content box of Query ID8. Edit Posts Widget (Pro) in Content>Layout, until you get a layout you are satisfied with, Save and exit the page.
9. Check Ultimate Member-Settings> appearance> profile menu> Automatically redirect author page to their profile? make sure to allow.
10. Done. Take a look at the page and if you are not satisfied, delete it. And restore the previously modified UM options.
I may not have explained it just now.I mean like this
You need to customize an Elementor query function. It’s the code I just posted and put it in the theme’s function.php
Then remember the name “my_custom_filter_1”, there is a custom filter in the query settings of the Post list widget, and fill in the name. This is where you need to fill in the name Sorry that my editor does not display English, but I think I can guess where to fill in the name based on the position on the picture.
This way you get a list of posts that lists both types of post and recipe at the same time
- This reply was modified 4 years, 3 months ago by sqkkyzx.
I will try to make the UM profile menu available by modifying the UM template file, so that the posts can be sorted by different tags on the menu. If it succeeds, I will tell you.
If you want to query multiple post types,
You should probably useadd_action( ‘elementor/query/my_custom_filter_1’, function( $query ) {
global $current_user;
$query->set( ‘post_type’, [ ‘post’, ‘recipe’] );
$query->set( ‘author’, um_profile_id() );
} );Frankly speaking, due to the differences in regional languages, I use the translated UM, so I don’t quite understand what CPT is.
I checked your page, and I think my method should be feasible to improve your current page layout, that is, a user avatar display and a list of posts.
Use a shortcode widget on a page, load the shortcode of the UM profile, and use a Post list widget to list the content with Elementor custom queries.- This reply was modified 4 years, 3 months ago by sqkkyzx.
@champsupertramp
Thank you so much!
It achieved the effect I needed very well. Successfully inquired about the posts of the current users, and had a beautiful grid layout.@kkriss
If you can use the query function to query Post and CPT, in theory, you can also use Elementor custom query. If you can, then I think my method is also suitable for you.About the use of Elementor custom queryer, you can find it in Elementor’s documentation. For example, The code that Champ Camba helped me change,”my_custom_filter_1″ is a unique name that can be set freely. It can be used to locate this query in the post list widget of the elementor Pro editor.”work” is my custom post type.um_profile_id() to help me locate the current author.
You can have a try.
Hello!
I have very little knowledge of code. So I must turn to you for help.
I want to know this query:add_action( ‘elementor/query/my_custom_filter_1’, function( $query ) {
global $current_user;
$query->set( ‘post_type’, [ ‘work’] );
$query->set( ‘author’, $current_user->id );
} );Is it possible to directly call the result of the UM queryer? For example, nesting is another method that allows me to use the UM query tool to query user posts, which may allow me to fix the unresolved problem raised by my last reply.
- This reply was modified 4 years, 3 months ago by sqkkyzx.
@kkriss
I also encountered this problem. I wanted to use Elementor to make a beautiful enough post archive page for users. But in the process of trying, it became two problems:1. When a logged-in user accesses his profile, his profile and posted posts will be displayed.
2. When the logged-in user accesses other users, the profiles and posts of other users are displayed.Then, I successfully implemented the first problem, But my implementation method may not apply to you. Because you have to show the CPT list. Just for your reference.image1image2
I used the UM shortcode and Elementor Pro’s post list widget on this page, and created the following Elementor custom query in functions.php:add_action( ‘elementor/query/my_custom_filter_1’, function( $query ) {
global $current_user;
$query->set( ‘post_type’, [ ‘work’] );
$query->set( ‘author’, $current_user->id );
} );But this method is not a good idea. And I can’t solve the second problem.
Because using the above method, only the posts of the currently logged-in user can be retrieved. When visiting other people, the posts of the author you want to query cannot be displayed.
I tried another method, instead of redirecting the author to archive to the user profile, but using Elementor’s archive template to create it, at this time, although the posts of the user I want to query can be listed correctly, the profile displayed by the UM shortcode It is always the currently logged in user.
I think the best way is to customize a template.
If you have a better plan, please let me know, thank you very muchNow I tried a new solution in order to get the user’s cover image.
As you said, using the short code [um_user meta_key=”cover_photo”] returned a url.
But I can still use the url to display pictures, Just use HTML tags img src=”[um_user meta_key=”cover_photo”]”- This reply was modified 4 years, 3 months ago by sqkkyzx.
I don’t understand any code knowledge, but I remember that the picture widget that comes with Elementor seems to be able to directly select the dynamic metadata of the user’s profile photo.
I have similar difficulties, but my problem is that I want to get a user cover image. I finally failed to solve it. However, if you are talking about a user profile photo, I am sure that Elementor Pro can dynamically obtain it directly, unless you must use a shortcode.
Sorry I cannot submit a ticket. Because I have refunded my purchase.
I am here only to make my suggestions. Of course, you can ignore my suggestions, or you can start to make improvements. My suggestions are about plug-in functional enhancements, not my personal support request.
If I see your improvement from the support document, I will buy it again, but before that, I am not going to just submit a ticket to buy it again and refund it.