Add WP-Like button to MediaPress

Intro

The following is to add a Like Button to the MediaPress Single Image page as well as to the lightbox image that shows up.

Installation

In your Theme file’s functions.php file, add the following code:

/*
Code to add WP-Like button to Mediapress Single Image Page and to Lightbox
*/
//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' );

function mpp_wpulike_show_button() {
	
	if( function_exists( 'wp_ulike_put_posts' ) ) {
		echo wp_ulike_put_posts('');
	}
	
}

Note

This adds a separate Like button to the Single Media Page and to the Lightbox. So, If someone hits the like button in the Lightbox, it doesn’t register on the Single Media Page.

You might want to not use the code to show it on the Lightbox.

This information comes from the following post.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *