Replies
- Daniel on June 7, 2021 at 12:39 pm in reply to: [Resolved] Mediapress Play Pause and speaker button changes position on hovering #38968
Hey Brajesh,
Thanks for the nice code it works now as a charm π
Thank you and have a nice day.
Regards
Daniel - Daniel on June 6, 2021 at 10:03 am in reply to: [Resolved] Mediapress Play Pause and speaker button changes position on hovering #38947
Hi guys,
You had time to look into it? I was trying to find right css but it’s not working. I think the :hover css is the right one and the :nothover is the wrong css, so that the :hover css should be the same as the :nothover π
Thanks and cheers,
Daniel - Daniel on June 3, 2021 at 8:32 pm in reply to: [Resolved] Mediapress Play Pause and speaker button changes position on hovering #38932This reply has been marked as private.
- Daniel on June 2, 2021 at 12:04 pm in reply to: [Resolved] Mediapress Play Pause and speaker button changes position on hovering #38912This reply has been marked as private.
- Daniel on April 17, 2021 at 1:41 pm in reply to: [Resolved] Mediapress Play Pause and speaker button changes position on hovering #37947This reply has been marked as private.
- Daniel on February 19, 2021 at 5:24 pm in reply to: How to redirect user to user profile page #36307This reply has been marked as private.
- Daniel on February 18, 2021 at 10:22 pm in reply to: Searching for plugin to create a BP custom user profile pic #36300
Hi Ravi,
Thanks but I am looking for a plugin to overwrite the grey standard anonymous profile pic of BuddyPress and replace it with a self-created pic. (I mean to replace the grey anonymous, random Buddypress Profile pic with a custom pic. I thought there is a plugin for that?
Thanks.
Regards
Daniel - Daniel on February 17, 2021 at 8:14 am in reply to: Buddypress Post Count to show on User BP page #36256
Hi Ravi,
Actually, I only have inserted the first code into functions.php and the code to call the function I haven’t inserted yet. But then when I uploaded the new functions.php, the website did not load anymore. It was a white screen with the following error message: βThere has been a critical error on this website.β Therefore I guess something is wrong with the first code:
function count_user_posts_by_type($userid, $post_type='YOUR_CUSTOM_POST_TYPE') { global $wpdb; $where = get_posts_by_author_sql($post_type, TRUE, $userid); $count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts $where" ); return apply_filters('get_usernumposts', $count, $userid); }
By the way, shouldn’t it say in the beginning “add function” instead of only “function”?
Thanks for your time.
Regards,
Daniel - Daniel on February 16, 2021 at 12:21 pm in reply to: Buddypress Post Count to show on User BP page #36246
Hi Brajesh,
I had used this exact code in child theme functions.php
function count_user_posts_by_type($userid, $post_type='YOUR_CUSTOM_POST_TYPE') { global $wpdb; $where = get_posts_by_author_sql($post_type, TRUE, $userid); $count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->posts $where" ); return apply_filters('get_usernumposts', $count, $userid); }
And then for the Buddypress member-header.php I have added this code:
<?php if ( $count = count_user_posts_by_type( bp_current_user_id(), 'YOUR_CUSTOM_POST_TYPE' ) ) echo "Total Recipes: " . $count; ?>
Thank you.
Regards
Daniel- This reply was modified 4 years, 4 months ago by
Daniel.
- This reply was modified 4 years, 4 months ago by
- Daniel on February 16, 2021 at 9:53 am in reply to: Buddypress Post Count to show on User BP page #36242
Hi Brajesh,
The code is actually not working. After inserting it into the child’s function.php then when loading the website it says “There has been a critical error on this website.” and the website is not loading anymore.
Did I miss inserting a syntax in the beginning of the function code? I have just copy-pasted the code above into the functions.php.
Thanks for the hint.
Regards
Daniel