Forum Replies Created
-
AuthorPosts
-
May 24, 2022 at 10:38 PM in reply to: ✅How does MB Avatar Plugin enable the front end user to upload his avatar? #36166
EddyPiV
ParticipantI did add the code to the functions.php file, but it's not affecting the profile picture. Changed it back to Single Upload fieldtype. Still no luck.
Then I did a plugin conflict test. It's conflicting with the BuddyBoss Platform Pro plugin. I also tried with priority 1 in the add_filter, but no difference either.
I think I will have to proceed with the BuddyBoss avatar, although it comes with a bunch of other stuff that I don't like.
Thanks Long for your help.
May 23, 2022 at 12:02 PM in reply to: ✅How does MB Avatar Plugin enable the front end user to upload his avatar? #36140EddyPiV
ParticipantHi Long,
All that I understand. But for doing so, I don't need to install & activate the MB User Avatar plugin. Actually, that plugin results in another field in the user profile than the created custom field. So with the plugin active I have 2 profile image fields.
I am puzzled about the so called solution of the MB User Avatar. It seems not to be used at all.
Or am I missing something?Then back to how to get it working. I think I have done all what's in the documentation (deactivated actually the Avatar plugin), but the WordPress Profile picture is not changing. I guess that's what you mean with "single_image with code", is that the code in the functions.php file?
Can you help me with the code that needs to be changed?May 17, 2022 at 1:50 PM in reply to: ✅How to query for user profile fields of the author of the current post? #36054EddyPiV
ParticipantI think I tried that, but didn't work. I must have made a mistake then, as it works now nicely.
Thanks Long
May 16, 2022 at 3:10 PM in reply to: ✅How to include private posts in overview of posts for author #36039EddyPiV
ParticipantHi Long, apparently both posts_per_page and numberpost work, but I changed according to your advise.
Yes, private posts are showing now.Thanks, working fine.
EddyPiV
ParticipantThanks Long, I found the solution through the FB group. Can you close this threat?
EddyPiV
ParticipantI understand what you're doing. But I'm concerned that over time, when both the number of recipes and the number of sales are growing, the performance will become an issue. And with an installed base by then, I'm afraid that getting that solved can become quite a headache.
Therefore I'm looking into a view per set of recipes, I'm sort of hardcoded reading the posts of the set (in this case 11 posts) and subsequently reading/checking which recipes of this set exist for the current user. I.e. getting the post based on the permalink with the username in it.
This way the number of posts to be read is limited to 2x number of recipes in the set.But my question then is how to read the post by permalink, and how to do the proper coding for the condition if the post exists.
Hope you can help me with that.
Thanks a lot!
EddyPiV
ParticipantHi Long,
Thanks for helping me each time a step further.
I find it hard to find all answers myself in WordPress codex and in other sources, although I'm spending hours on it. And yet I have to come to you with what I believe are so basic questions.
I managed to get everything in order. Only part left ìs the condition if a recipe for the buyer exists.
I'll share my code. It results in a critical error on the website.
First I read the standard recipes from 1 package. Then I'll check which recipes of the package exist for the current user, and I show the details. (slug for the recipe for the buyer = <userid>>-recipe-01 etc.)'''
{% set args = { post_type: 'xtra', include: [ 281, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292 ], order: 'asc' } %}
{% set posts = mb.get_posts( args ) %}
{% set user_ID = mb.get_current_user_id() %}
{% set abs_path = 'https://example.com/xtra/' %}
{% set rel_path = 'xtra/' %}<div class="xtra_container">
{% for post in posts %}
{% if ( $page = mb.get_page_by_path( {{ rel_path }}{{ user_ID }}-{{ post.post_name }} ) ) %}
{
<div class="xtra_item">
{% set post_link = mb.get_permalink( post.ID ) %}
<h3>{{ post.post_title }} </h3>
[su_row][su_column size="1/2" center="no" class=""]{{ mb.get_the_post_thumbnail( post.ID, 'thumbnail' ) }} [/su_column]
[su_column size="1/2" center="no" class=""][icon name="calendar-check" prefix="fas"] {{ post.post_modified | date( 'F j, Y' ) }} <br> [icon name="comment" prefix="fas"] {{ post.comment_count }} [/su_column][/su_row]
</div>
}
{% endif %}
{% endfor %}
</div>
'''Can you help me to get this corrected?
EddyPiV
ParticipantActually, my question is more complex.
Clients can buy a series of recipes. They become gradually available to the buyer.
There is a standard set of recipes, with permalinks .../cpt/recipe-01, -02, -03 etc.
At preset interval the next recipe of the standard set is released to the buyer, by copying the standard recipe to .../cpt/<username>-recipe-01, -02 etc.
This is all working fine.I want to show an overview of the released recipes to the buyer.
For several reasons I want to do that with the standard set of recipes as starting point, by looking if the permalink .../cpt/<username>-recipe-01, 02 etc. exist.Therefore I need the following steps:
- determine the slug of the standard recipe (my starting question)
- find out for each recipe if a post for the buyer exists.Next to my starting question on the slug, I'm having difficulty with
- getting the username
- determining if a post for the buyer exists.I hope you can help me.
EddyPiV
ParticipantFound it!
EddyPiV
ParticipantThat would be very good indeed. Just was looking for that.
September 19, 2021 at 7:03 PM in reply to: ✅How to show user profile field for specific user (not current or author)? #30826EddyPiV
ParticipantThanks Long.
EddyPiV
ParticipantHi,
The custom taxonomy is a Standard WordPress Metabox. https://share.getcloudapp.com/eDuy5Ayq
It looks like conditional logic only works for fields within the same field group. I have different field groups, as the cutsom taxonomy applies to many post types, while the checkbox field only applies to posts. With the toggle rule I can set the rule based on the custom taxonomy, with the conditional logic I cannot.
Any suggestion?
EddyPiV
ParticipantThanks Long, it's working.
EddyPiV
ParticipantHi Long,
I'm back on this issue.
When I added the code as suggested by you to the functions.php, it worked very nicely.
But... another subsite on the same multisite installation, using the same child theme, crashed.Reasson: Uncaught Error: Call to undefined function rwmb_meta() in /var/web/site/public_html/wp-content/themes/materialis-pro-child/functions.php:88
That subsite doesn't have Meta Box activated. When I activate the plugin, it's working.
But that's not the correct way, obviously.
Can you please help me with the correct code to keep subsites without Meta Box activated working as well?
Thanks for your help, kind regards,
EddyEddyPiV
ParticipantHi Long,
I don't know what happened, but the code was not the root cause of the severe error.
So please ignore my previous comments. -
AuthorPosts