• Hi all,

    Can I define the content to be shared by default? e.g. only {post_content}
    I don’t want to display the link and not the title.
    Even better would be: Content up to the read-more button

    • This topic was modified 4 months, 2 weeks ago by behandlung.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Dharmesh Patel

    (@dharm1025)

    Hi @behandlung,

    Thanks for reaching out to us.

    You can define the content to be shared at the post level by adding content to the “Custom message” field. However, we currently don’t have a UI for setting the default share content. We have an open issue for this, but there is no scheduled timeline for adding it to the plugin.

    For now, you can use the autoshare_for_twitter_body filter to tweak the tweet body content to be shared. For example, if you want to share the post excerpt, you can use the following code snippet to do that:

    add_filter(

    'autoshare_for_twitter_body',

    function( $tweet_body, $post ) {

    // Bail if we have a custom message.

    $custom_message = get_post_meta( $post->ID, 'autoshare_tweet-body', true );

    if ( ! empty( $custom_message ) ) {

    return $tweet_body;

    }

    // If we have an excerpt, use that.

    $excerpt = get_the_excerpt( $post );

    if ( ! empty( $excerpt ) ) {

    $tweet_body = $excerpt;

    }

    return $tweet_body;

    },

    10,

    2

    );

    Hope this helps you.

    Thank you.

    Thread Starter behandlung

    (@behandlung)

    Thank you very much!
    Before I test this one… do you think it will share Elementor Postings too?
    Lot of those Twitter-Autoposts have problems with Elementor

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.