Ok, here is the code that worked for me, it’s simpler and so far, I haven’t found a weakness, but yet again, I don’t know what I’m doing. I replaced some code in the very standard twitter share button to include the username as a function and not hard-coded, as some examples of the code ask you to fill it in manually.
Full disclosure, I don’t fully comprehend the js portion at the end of @dori92’s code and I am using a simplified version, so please keep this in mind if there is something special reason to include that part.
Here it is:
<a href="https://twitter.com/share?url=<?php echo urlencode(wp_get_shortlink()); ?>&counturl=<?php urlencode(the_permalink()); ?>" class="twitter-share-button" data-count="vertical" data-via="<?php echo of_get_option( 'ac_twitter_username' ); ?>">Tweet</a><script type="text/javascript" src="https://platform.twitter.com/widgets.js"></script>
Remember to keep the span tags before and after this code, as in the standard code on justwrite’s documentation.