Bruce Reyes-Chow
asked 9 years ago

When someone share via the twitter share button, I would like to automatically add via @breyeschow after the link or title.

2 Answers
Allen
answered 9 years ago

Your problem is fixed now 🙂

DominicStaff
answered 9 years ago

Hi,
Apologies for the delay in replying to you. To resolve this issue, you can open the single.php file in the folder path “wp-content\themes\dw-fixel”. Find the line 15 then replace the following code: 

<li><a class="twitter" href="https://twitter.com/intent/tweet?source=webclient&amp;text=<?php echo get_the_title() . rawurlencode( $url ) ?>" title="<?php _e('Share to Twitter',DW_TEXTDOMAIN) ?>" target='_blank'><i class="icon-twitter"></i><span><?php echo dw_get_twitter_count( $url ); ?></span></a></li>

With new code:

<li><a class="twitter" href="https://twitter.com/intent/tweet?source=webclient&amp;text=<?php echo get_the_title() . rawurlencode( $url ) ?> @breyeschow" title="<?php _e('Share to Twitter',DW_TEXTDOMAIN) ?>" target='_blank'><i class="icon-twitter"></i><span><?php echo dw_get_twitter_count( $url ); ?></span></a></li>

Hope this helps !

Bruce Reyes-Chow
replied 9 years ago

Thanks so much. That did solve one problem. One very small tweak is needed. When I click on the share, there is not space between the title and the url. Where should I add a space? http://www.reyes-chow.com/2014/09/10-important-questions-to-ask-when-choosing-a-high-school-in-san-francisco/

Dominic Staff
replied 9 years ago

You can replace with new code:

<li><a class="twitter" href="https://twitter.com/intent/tweet?source=webclient&text=&lt;?php echo get_the_title() .' '. rawurlencode( $url ) ?> @breyeschow" title="<?php _e('Share to Twitter',DW_TEXTDOMAIN) ?>" target='_blank'><i class="icon-twitter"></i><span><?php echo dw_get_twitter_count( $url ); ?></span></a></li>

Hope this helps !

Bruce Reyes-Chow
replied 9 years ago

That didn’t work. Code messed up the side bar. Went back to the first suggestion, so still have the issue with no space between the title and the http://

Bruce Reyes-Chow
replied 9 years ago

This is what it looks like without the space before the http, “Nine Reasons to Go See Selmahttp://www.reyes-chow.com/2014/12/go-see-selma/ via @breyeschow”

Bruce Reyes-Chow
replied 9 years ago

Figured it out

Powered by DW Question & Answer Pro