Create Inline Tweet in WordPress Inline To Simply Create Hyperlinks to Share Content on twitter With a Twitter CSS Icon Font With Extra Load. Basically, what you read on our website are what they are implemented on high end Custom Themes. Practically, most of them are available as free software.
When we are talking about CSS Icon Font, definitely we can use Base64 Encoding and HTML5 i class
to use something which suits our own website’s design.
Create Inline Tweet in WordPress : PHP Way
New users will prefer Plugin Way to Create Inline Tweet in WordPress. We do not recommend to use hundreds of Plugins, the complexity increases with increasing number of plugins. Most of the functions actually are of PHP MySQL, either in combination or alone or just some usage of WordPress function.
---
In any case, if you go for the Plugin Way, you can point towards WordPress Plugin Repository and search with the phrase Inline Tweet
.
Create Inline Tweet in WordPress : Our Own Way
We will adapt some part from existing Open Source Library and Some Parts from our own old Tutorials to create beautiful Inline Tweet in WordPress with CSS Icon Font or CSS Base64 Encoding.
So, when we are talking about CSS Icon Font or CSS Base64 Encoding; we should refer to the older articles and / or guides on the mentioned topics :
Icon Font is nothing but the nice Icons which you can see top right of this webpage – those Icons of Twitter, Google Plus, RSS Links etc. Practically we can embed them here too :
i class
get rendered when the library loads. We need some stuffs to make universally working.
Actually, this is a good Library to Create Inline Tweet in WordPress, but it is too much bloated with Paypal stuffs and old CSS methods :
1 | https://github.com/rhyswynne/inline-tweet-sharer/ |
So, first download the whole repo on your desktop. We could do it for you, but those of you keen to learn modifying the plugins and checking plugins for Third Party Javascript (remember, they can steal your privacy and security) and nulling them should start from this type of guide. It is GNU GPL 2.0. We will Add both GNU GPL 3.0 and Apache License so that anyone can use it.
Things are arranged in this manner :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | + [languages] [ No need ] | +---bitly.php +---editor_plugin.js +---inline-tweet-sharer-admin.css +---inline-tweet-sharer.css [ No need . We will modify ] +---inline-tweet-sharer.js +---inline-tweet-sharer.php +---inline-tweet-sharer.zip [ No need. wtf, plugin zip within plugin... ] +---paypal.gif [ No need ] +---readme.txt +---twitter-bg-hover.png [ No need ] +---twitter-bg.png [ No need ] +---twitter.png [ No need ] |
First edit the inline-tweet-sharer.php file. Comment out the not required stuffs with // like :
1 | //define("ITS_DONATE_LINK","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SBVM5663CHYN4"); |
Change the Plugin URL to your own website’s URL. Like :
1 2 | define("ITS_PLUGIN_URL","https://thecustomizewindows.com/"); //where https://thecustomizewindows.com/ is your website |
But, we will not load the CSS file for frontend. Because the Twitter Icon-Font or Base64 File is either already in your existing CSS or you can add the lines – actually this is manually combining CSS files. You already know how to add the CSS files for Icon Font. If you do a bit work, actually there will be one PHP file, one Js.
Actually, the basic PHP + WordPress function we need is :
1 | $url = 'https://twitter.com/intent/tweet?url=' . urlencode($permalink) . '&text=' . $tweetlinkstring; |
Basic things are =>
+ Get the Post Permalink
+ Add custom Text fetching from the linked sentence
+ Icon Font etc. CSS stuffs to make it good looking
+ Usage of some minimal HTML5 functions
Create Inline Tweet in WordPress : Javascript Way (cream)
@Anywhere library or other ways. First, make sure you have jQuery included in your document’s head. Then create a link that has the same URL as the eventual tweet button, along with an empty div where your button will be rendered:
At the bottom of your page, right above the /body tag, include the javascript from Twitter and the function that will render the button, as well as the listener that will activate the function when the desired event takes place:
Lastly, add a link to your page somewhere that will activate the function above based on some event:
Other ways are :
(1) Using node.js :
1 | http://twitter.github.io/hogan.js/ |
(2) Using Tempo script :
1 | http://twigkit.github.io/tempo/ |