Modificar iconos de WPTouch (plugin de WP)

Quitar los iconos de redes sociales y email del pie de página en WPTouch (versión gratuita)

WPTouch es un plugin de WordPress que se ofrece en 2 versiones, una de pago llamada WPTouch Pro y otra gratuita llamada solamente WPTouch. Sirve para mostrar en tabletas y smartphones una versión del sitio web diseñada específicamente para dispositivos móviles.

Entre las opciones disponibles en la versión Pro que faltan en la gratuita está la de mostrar o no iconos de redes sociales y email en el pie de los artículos. A mí personalmente no me gusta mostrarlos. Se trata de varios iconos, por este orden:

  • artículo anterior
  • enviar por email
  • abrir Twitter
  • abrir Facebook
  • abrir un área que contiene enlaces a varios sitios (Del.icio.us, Digg, Technorati, Magnolia, Newsvine y Reddit)
  • artículo siguiente.
wptouch1

Los botones de Twitter y Facebook se quitan modificando el archivo wptouch/themes/core/core-functions.php. Los otros botones se quitan modificando el archivo wptouch/themes/default/single.php. Deseo conservar los botones de navegación entre artículos. Todo ello referido a la versión 1.9.6.1 del plugin que es la actual.

core-functions.php

Busca este texto:

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>'; 
}

Borra la segunda línea completa, ha de quedar así

function wptouch_twitter_link() {
}

Haz lo mismo con el texto

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>"; 
}

dejándolo así

function wptouch_facebook_link() { 
}

Con ello quitamos los iconos de Twitter y Facebook:

wptouch2

single.php

Busca este bloque que coloca los iconos de navegación, email y sitios sociales:

        <ul id="post-options">
        <?php $prevPost = get_previous_post(); if ($prevPost) { ?>
            <li><a href="<?php $prevPost = get_previous_post(false); $prevURL = get_permalink($prevPost->ID); echo $prevURL; ?>" id="oprev"></a></li>
        <?php } ?>
        <li><a href="mailto:?subject=<?php
bloginfo('name'); ?>- <?php the_title_attribute();?>&body=<?php _e( "Check out this post:", "wptouch" ); ?>%20<?php the_permalink() ?>" onclick="return confirm('<?php _e( "Mail a link to this post?", "wptouch" ); ?>');" id="omail"></a></li>
        <?php wptouch_twitter_link(); ?>
        <?php wptouch_facebook_link(); ?>
        <li><a href="javascript:return false;" id="obook"></a></li>
        <?php $nextPost = get_next_post(); if ($nextPost) { ?>
            <li><a href="<?php $nextPost = get_next_post(false); $nextURL = get_permalink($nextPost->ID); echo $nextURL; ?>" id="onext"></a></li>
        <?php } ?>
        </ul>
    </div>

Borramos lo que corresponde a los iconos que deseo eliminar

        <?php } ?>
        <li><a href="mailto:?subject=<?php
bloginfo('name'); ?>- <?php the_title_attribute();?>&body=<?php _e( "Check out this post:", "wptouch" ); ?>%20<?php the_permalink() ?>" onclick="return confirm('<?php _e( "Mail a link to this post?", "wptouch" ); ?>');" id="omail"></a></li>
        <?php wptouch_twitter_link(); ?>
        <?php wptouch_facebook_link(); ?>
        <li><a href="javascript:return false;" id="obook"></a></li>

dejándolo así

    <ul id="post-options">
    <?php $prevPost = get_previous_post(); if ($prevPost) { ?>
        <li><a href="<?php $prevPost = get_previous_post(false); $prevURL = get_permalink($prevPost->ID); echo $prevURL; ?>" id="oprev"></a></li>
    <?php $nextPost = get_next_post(); if ($nextPost) { ?>
        <li><a href="<?php $nextPost = get_next_post(false); $nextURL = get_permalink($nextPost->ID); echo $nextURL; ?>" id="onext"></a></li>
    <?php } ?>
    </ul>
</div>

También se puede borrar el siguiente bloque que sería el encargado de mostrar los enlaces a Del.icio.us y los otros sitios. Con ello la barra de iconos se muestra así:

wptouch3

Nota: haz copia de seguridad de los 2 archivos antes de modificarlos.