WordPress.org

Forums

Post Share Count
[resolved] Include @via in the tweet? (5 posts)

  1. ckubs
    Member
    Posted 1 year ago #

    Hello and many thanks for this plugin. I was tired of the same standard share buttons, icons and Shereaholic wich is a bit too heavy.

    I have a theme that has already integrated the standard share buttons( twitter, facebook, google+) and in the case of twitter I have the option to imput my twitter username in theme admin and when I tweet an article is called with that code <?php echo of_get_option( 'ac_twitter_username' ); ?> and outputs it as @via( tweet via @testuser ..etc). Is there a way I can add that in your plugin hook or donno, something like that to do the same thing?

    Oh, and about the social links they work only called all or I can put as many hooks as I want with let's say, one just facebook, one just twitter ...etc?

    https://wordpress.org/plugins/post-share-count/

  2. zviryatko
    Member
    Plugin Author

    Posted 1 year ago #

    Hello!

    I thought that no one but me uses this plugin =)

    And yes, you can add @via text to twitter link and hide some social counters.

    <?php
    $share_args = array(
        'before_twitter' => '<span class="twitter-share-link"><a href="https://twitter.com/intent/tweet?text=' . urlencode(get_the_title()) . '&url=' . urlencode(get_permalink()) . ' . '&via=' . urlencode('your-twitter-name') . '" rel="nofollow" target="_blank">',
        'show_only' => array('twitter', 'facebook'),
    );
    the_post_share_count( $share_args );
    ?>
  3. ckubs
    Member
    Posted 1 year ago #

    Yes I see but can I put my theme function <?php echo of_get_option( 'ac_twitter_username' ); ?> instead of your-twitter-name to make use of it?

    BTW the plugin rocks and that is what I'll use from now on. Rated 5 stars :)

  4. zviryatko
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, you can, but instead of echo of_get_option('ac_twitter_username') use just of_get_option('ac_twitter_username')

    I think topic can be marked as resolved?

  5. ckubs
    Member
    Posted 1 year ago #

    Yes it can :) Thanks

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Post Share Count
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic