• Hi,

    I set the plugin to be displayed automatically at the bottom of the posts ONLY. I don’t need it to be displayed on pages (I mean not automatically).

    Now I need to add a like button only on the homepage. But since I unchecked the setting “page” in “Enable for this post types”, shortcodes I add are not displayed.

    Is there a way I can achieve that?

    • This topic was modified 8 years, 4 months ago by cihat74.
Viewing 1 replies (of 1 total)
  • Thread Starter cihat74

    (@cihat74)

    For the ones who need, here is the solution to my own request:

    1- Add the code below in your theme’s functions.php file.

    function custom_content_after_post($content){
    if (is_single()) {	
    	$content .= '[kodex_post_like_buttons]';
    }
    	return $content;
    }
    
    add_filter( "the_content", "custom_content_after_post" );

    2- On the settings page of kodex, under enable for this post types tick post and under Show on the top of post choose Don’t show automatically..

    Now you can add your shortcode to the pages you want.

    Cheers.

Viewing 1 replies (of 1 total)
  • The topic ‘A Different Scenario’ is closed to new replies.