I tried to implement adding WP ULike buttons to my MediaPress Single Media Pages and Lightbox. According to https://buddydev.com/mediapress-like-unlike-button-for-photos-videos-etc-with-wp-ulike-plugin/, I added the following to my functions.php file in BuddyX Child theme (which I’m currently using on my site:
/* Code to add WP-Like button to Mediapress Single Image Page and to Lightbox */ function mpp_wpulike_show_button() { if( function_exists( 'wp_ulike_put_posts' ) ) { echo wp_ulike_put_posts(''); } //show it on single media page add_action( 'mpp_media_meta', 'mpp_wpulike_show_button' ); //show it in lightbox add_action( 'mpp_lightbox_media_meta', 'mpp_wpulike_show_button' ); }
But nothing is showing on the page or in the Lightbox.
Hello,
Please try the following code:
function mpp_wpulike_show_button() { if( function_exists( 'wp_ulike_put_posts' ) ) { echo wp_ulike_put_posts(''); } } //show it on single media page add_action( 'mpp_media_meta', 'mpp_wpulike_show_button' ); //show it in lightbox add_action( 'mpp_lightbox_media_meta', 'mpp_wpulike_show_button' );
Regards
RaviI added the code to functions.php in my theme folder and still don’t see the ‘Like’ button appearing. I’m wondering if it has anything to do with the settings in WP ULike. In the settings, there is a tab for Post Type. I can toggle the display of the Like buttons in Posts, BuddyPress Activity, and bbPress. I’m wondering if WP ULike is even aware of the Single Media page and the Lightbox?
Is the code to display the Like button that you’ve provided going to even register within WP ULike? Is this even possible without having to mess with thw WP ULike plugin itself?
Hello,
I have tried the following code:
function mpp_wpulike_show_button() { if( function_exists( 'wp_ulike' ) ) { echo wp_ulike('put'); } } //show it on single media page add_action( 'mpp_media_meta', 'mpp_wpulike_show_button' ); //show it in lightbox add_action( 'mpp_lightbox_media_meta', 'mpp_wpulike_show_button' );
It is working for me.
Regards
Ravi
You must be logged in to reply to this topic.