Forum Replies Created
-
AuthorPosts
-
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.EddyPiV
ParticipantSorry, I was fighting with the code. But I hope you can work on it, right?
EddyPiV
ParticipantHi Long,
Getting back on this issue.
My installation is a multisite. The code to copy custom_avatar to the standard wordpress profile picture works nicely for the subsite running MetaBox, but 2 other sites using the same (child) theme are facing critical errors.
When taking out the code, they're back to normal.This is the code I have:
`
/* MetaBox - replace WP gravatar with custom gravatar */
add_filter( 'get_avatar' , 'my_custom_avatar' , 1 , 5 );
function my_custom_avatar( $avatar, $id_or_email, $size, $default, $alt ) {
$user = false;
if ( is_numeric( $id_or_email ) ) {
$id = (int) $id_or_email;
$user = get_user_by( 'id' , $id );
} elseif ( is_object( $id_or_email ) ) {
if ( ! empty( $id_or_email->user_id ) ) {
$id = (int) $id_or_email->user_id;
$user = get_user_by( 'id' , $id );
}
} else {
$user = get_user_by( 'email', $id_or_email );
}if ( $user && is_object( $user ) ) {
$value = rwmb_meta( 'custom_avatar', array( 'object_type' => 'user' ), $user->data->ID );
$value = reset( $value );
if ( $value ) {
$avatar = "<img alt='" . $alt . "' height='" . $size . "' width='" . $size . "' />";
}
}
return $avatar;
}
`
Is something extra needed to handle this multisite installation?EddyPiV
ParticipantThanks a lot, Long.
Perhaps it makes sense to change the article https://metabox.io/create-custom-avatar/ accordingly, as I would expect not many webmasters would like to give their members access to the media library.
Anyway, it works very nicely now. Thanks again.
April 11, 2021 at 5:09 PM in reply to: ✅Tag Archive - my view gets ignored when rendering "Only the post content area" #27151EddyPiV
ParticipantThanks Long, I understand and managed to get it working.
EddyPiV
ParticipantHi Long,
Yes, I forgot the array.
But that makes the code for the functions.php more complicated for me, as I struggle to combine it with the array for the object type 'user'. (Critical errors...)
Can you help please?
Thanks.April 11, 2021 at 4:12 AM in reply to: ✅Tag Archive - my view gets ignored when rendering "Only the post content area" #27131EddyPiV
ParticipantHi Long,
I haven't seen a response from you.
I wish it would work as you say, but it doesn't look like it.
To demonstrate my case:
- This setting (https://share.getcloudapp.com/nOuok1RO) leads to this view (https://share.getcloudapp.com/nOuok1Xg)- This setting (https://share.getcloudapp.com/mXupybxr) leads to this view (https://share.getcloudapp.com/wbuw7vXG)
So for some reason it looks like replacing the post content area gets ignored in my case.
Where am I going wrong?
March 23, 2021 at 8:04 PM in reply to: ✅Tag Archive - my view gets ignored when rendering "Only the post content area" #26619EddyPiV
ParticipantWhat I'm trying to say is that for "Render for: Only the post content area" and "Position: Replaces the post content" my commands in the Views are ignored, as the default WP archive layout gets applied.
It does work for the other rendering options, but that's not what I want.
EddyPiV
ParticipantAh, good to know. Yes, it's working nicely. Thanks!
-
AuthorPosts