Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter beacampera

    (@beacampera)

    Thanks! It’s work

    Thread Starter beacampera

    (@beacampera)

    Hi,

    It works, but share buttons also display in page.
    I want it to only show in single post.

    Is there any way to do it?

    I’m reading that it can do it with the conditional if is_single, but I I can’t get it to work.

    Can someone help me?

    Here is my code in functions-php

    function xe_share_button() {
    $share_url = urlencode(get_the_permalink());
    $share_title = urlencode(html_entity_decode(get_the_title(), ENT_COMPAT, ‘UTF-8’));
    $media = urlencode(get_the_post_thumbnail_url(get_the_ID(), ‘full’));

    include( locate_template(‘social-share.php’, false, false) );
    }

    add_action( ‘generate_after_entry_header’, function() {
    if ( function_exists(‘xe_share_button’) ) {
    xe_share_button( ‘<div class=”compartir-rrss”><p id=”compartir”>’,'</p></div>’ );
    }
    } );

    • This reply was modified 3 years, 3 months ago by beacampera.
Viewing 2 replies - 1 through 2 (of 2 total)