• Resolved audiowarrior

    (@zonwarrior)


    Hi Robin,

    Love your plugin! 2 questions:

    1. Facebook share: Is it possible to remove the sharing of the post’s body content?
    https://imgur.com/a/uSecRTJ

    Thus, I only want to share the featured image + post title on Facebook shares.

    2. I have Social Sharing set to ‘Before Content‘ and ‘After Content.’ Is it possible to remove ‘Share this post’ Heading for ‘Before Content’ and leave it enabled for ‘After Content’ ?

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Robin Cornett

    (@littlerchicken)

    On the first question, Scriptless cannot do anything with what Facebook “sees” from your site. All Scriptless is providing is the URL for your page. Everything else is handled by OpenGraph tags, if they are present, which will be populated by another plugin or possibly your theme. For my own site, for example, the title, featured image, and description are all populated by Yoast SEO. I believe the description that is used for the OpenGraph tag comes from the excerpt I set for the post.

    For your second question, that’s doable, but a little tricky, because the automatic output of the plugin can’t manage the heading differently for one location over another. What you can do is set up the plugin to automatically output the sharing buttons, with your preferred heading, only at the end of the post. Then, you can output the buttons manually, without the heading, at the beginning of the post, with this filter:

    
    add_filter( 'the_content', 'prefix_output_scriptless_without_heading' );
    /**
     * Output the scriptless sharing buttons at the beginning of the content
     * without a heading.
     *
     * @param string $content
     * @return string
     */
    function prefix_output_scriptless_without_heading( $content ) {
    	if ( function_exists( 'scriptlesssocialsharing_do_buttons' ) ) {
    		$content = scriptlesssocialsharing_do_buttons( false ) . $content;
    	}
    
    	return $content;
    }
    

    You will want to place that in your theme’s functions.php file or a safe place where you add code snippets to your site. Please practice safe coding and make sure your files are backed up. Hope that helps!

    Thread Starter audiowarrior

    (@zonwarrior)

    Great thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘2 questions’ is closed to new replies.