Removing social networking links from WPtouch (free version)
I hate social networking.
If you're a regular reader of this site, you probably know that by now.
While I truly love the WPtouch mobile plugin for WordPress, and while I really should upgrade to the Pro version (note to self: let's do this before the end of the year), I absolutely hate those links to Tw-tter and F-c-book at the bottom of each article. I do like the email and bookmark links, though, as well as the navigation buttons.
A little poking around got me what I needed to find. The hack is fairly simple.
You want to dig down to wp-content/plugins/wptouch/themes/core/core-functions.php. Make a backup copy of the existing file, and then open the original in your favorite editor. Search down the file until you find:
function wptouch_twitter_link() { echo '<li><a href="javascript:(function(){var%20f=false,t=true,a=f,b=f,u=\'\',w=window,d=document,g=w.open(),p,linkArr=d.getElementsByTagName(\'link\');for(var%20i=0;i%3ClinkArr.length&&!a;i++){var%20l=linkArr[i];for(var%20x=0;x%3Cl.attributes.length;x++){if(l.attributes[x].nodeName.toLowerCase()==\'rel\'){p=l.attributes[x].nodeValue.split(\'%20\');for(y=0;y%3Cp.length;y++){if(p[y]==\'short_url\'||p[y]==\'shorturl\'||p[y]==\'shortlink\'){a=t;}}}if(l.attributes[x].nodeName.toLowerCase()==\'rev\'&&l.attributes[x].nodeValue==\'canonical\'){a=t;}if(a){u=l.href;}}}if(a){go(u);}else{var%20h=d.getElementsByTagName(\'head\')[0]||d.documentElement,s=d.createElement(\'script\');s.src=\'http://api.bit.ly/shorten?callback=bxtShCb&longUrl=\'+encodeURIComponent(window.location.href)+\'&version=2.0.1&login=amoebe&apiKey=R_60a24cf53d0d1913c5708ea73fa69684\';s.charSet=\'utf-8\';h.appendChild(s);}bxtShCb=function(data){var%20rs,r;for(r%20in%20data.results){rs=data.results[r];break;}go(rs[\'shortUrl\']);};function%20go(u){return%20g.document.location.href=(\'http://mobile.twitter.com/home/?status=\'+encodeURIComponent(document.title+\'%20\'+u));}})();" id="otweet"></a></li>'; }
and remove the second line (highlighted), ending up with:
function wptouch_twitter_link() { }
and then do the same with the following:
function wptouch_facebook_link() { echo "<li><a href=\"javascript:var%20d=document,f='http://www.facebook.com/share',l=d.location,e=encodeURIComponent,p='.php?src=bm&v=4&i=1297484757&u='+e(l.href)+'&t='+e(d.title);1;try{if%20(!/^(.*\.)?facebook\.[^.]*$/.test(l.host))throw(0);share_internal_bookmarklet(p)}catch(z)%20{a=function()%20{if%20(!window.open(f+'r'+p,'sharer','toolbar=0,status=0,resizable=1,width=626,height=436'))l.href=f+p};if%20(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else{a()}}void(0)\" id=\"facebook\"></a></li>"; }
removing the second line again, leaving:
function wptouch_facebook_link() { }
Save the modified file.
This hack changes:
into this:
Note that with each update to the plugin you will need to re-do this hack. A nicer way would be for BraveNewCode to support a preference (and they do in the Pro version, which I would highly recommend).
This post should in no way be taken as an endorsement to use the free version instead of the Pro version, but rather as an example of what can be achieved by poking around in the code for yourself, and tailoring things to fit your particular needs.
N.B.: Thanks to Lisa for the hint about the incorrect file pointer in the original version of this article!
Last Updated on by LewisR
Related posts:
- Removing the WP Post to PDF icon in WPTouch Good code is truly nice to work with. There's...
- Removing the WP Post to PDF icon in WPTouch Pro WPTouch Pro is really a nice piece of work,...
- Why should CPAs care about the cloud? Let’s count the ways Why do articles such as this present such a...
- Egad! Why do people do their own web development? The average person nowadays brushes his or her own teeth,...
- Wrestling with Apache’s mod_rewrite Sometimes, it's necessary to review the obvious in order to...
Enjoy this article?
Recent Posts
- Novell Client for Windows (32-bit) Internal Error 0x00008993
- Noisy utility company email
- The importance of Common User Access design guidelines in 2018
- Navigating Coinbase’s customer support
- Configuring the IOGEAR GWU627 wireless ethernet bridge device under ArcaOS (and OS/2)
Categories
Support Pages
Posts by Date
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
« Jun | ||||||
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Log In
Email Notifications
RSS Feeds
Recent Comments
- LewisR on Installing Windows Server 2008 R2 x64 on the HP Proliant DL380 G4
- LewisR on Installing Windows Server 2008 R2 x64 on the HP Proliant DL380 G4
- justintd on Installing Windows Server 2008 R2 x64 on the HP Proliant DL380 G4
- LewisR on WP Post to PDF Enhanced
- pdfsc on WP Post to PDF Enhanced
September 4th, 2012 - 13:10
This hack just tested with
1.9.5.11.9.5.2, and seems to work as before.