Código para botones de Twitter y Facebook en WordPress sin plugins

  • Autor Autor José Jiménez
  • Fecha de inicio Fecha de inicio

José Jiménez

Eta
Verificación en dos pasos activada
Verificado por Whatsapp
Hola queria saber si alguien por ahi tiene el codigo de los botones para hacer retweets de twitter y el share de facebook, el codigo para wordpress, pero no quiero un plugin ya que el plugin no creo que me deje colocarlos exactamente donde yo quiero. Saludos:biggrin:
 
Puedes hacerlo de dos maneras, un enlace con clase en CSS o la basica:

Para facebook:

PHP:
<a rel="nofollow" title="Compartir en facebook" href="http://www.facebook.com/sharer.php?u=<?php the_permalink(); ?>"><img src="url_de_boton_facebook" /></a>

Para twitter:


PHP:
<a rel="nofollow" title="Twittear esto"  href="http://twitter.com/home/?status=Estoy leyendo: <?php the_title(); ?> <?php the_permalink(); ?>"><img  src="url_de_boton_twitter" /></a>
 
u,u no me funciono, solo me aparecio como una imagen recortada :S
 
Mi iconera social en un blog tengo puesto esto en single.php justo debajo del argumento the_content:

Insertar CODE, HTML o PHP:
                  <ul>

                      <li><a title="RSS" href="<?php bloginfo('rss2_url'); ?>" rel="nofollow">

                                <img alt="RSS" title="RSS" src="<?php bloginfo('template_url'); ?>/images/rss_32.png" /></a>

                            </li>

                            <li><a title="del.icio.us" href="http://delicious.com/post?url=<?php the_permalink(); ?>&amp;title=<?php echo urlencode(get_the_title($id)); ?>" rel="nofollow">

                                <img alt="del.icio.us" title="del.icio.us" src="<?php bloginfo('template_url'); ?>/images/delicious_32.png" /></a>

                            </li>

                     <li><a title="StumbleUpon" href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php echo urlencode(get_the_title($id)); ?>" rel="nofollow">

                                <img alt="StumbleUpon" title="StumbleUpon" src="<?php bloginfo('template_url'); ?>/images/stumbleupon_32.png" /></a>

                            </li>

                            <li><a title="Digg" href="http://digg.com/submit?phase=2&amp;url=<?php the_permalink(); ?>" rel="nofollow">

                                <img alt="Digg" title="Digg" src="<?php bloginfo('template_url'); ?>/images/digg_32.png" /></a>

                            </li>

                     <li><a title="Facebook" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&amp;t=<?php echo urlencode(get_the_title($id)); ?>" rel="nofollow">

                                <img alt="Facebook" title="Facebook" src="<?php bloginfo('template_url'); ?>/images/facebook_32.png" /></a>

                            </li>

                            <li><a title="Twitter" href="http://twitter.com/home?status=<?php echo urlencode("Estoy leyendo: "); ?><?php the_permalink(); ?>" rel="nofollow">

                                <img alt="Twitter" title="Twitter" src="<?php bloginfo('template_url'); ?>/images/twitter_32.png" /></a>

                            </li>

                     <li><a title="Technorati" href="http://technorati.com/faves?add=<?php bloginfo('url'); ?>" rel="nofollow">

                                <img alt="Technorati" title="Technorati" src="<?php bloginfo('template_url'); ?>/images/technorati_32.png" /></a>

                            </li>

                            <li><a title="NewsVine" href="http://www.newsvine.com/_tools/seed&amp;save?u=<?php the_permalink(); ?>&amp;h=<?php echo urlencode(get_the_title($id)); ?>" rel="nofollow">

                                <img alt="NewsVine" title="NewsVine" src="<?php bloginfo('template_url'); ?>/images/newsvine_32.png" /></a>

                            </li>

                     <li><a title="LinkedIn" href="http://www.linkedin.com/shareArticle?mini=true&amp;url=<?php the_permalink(); ?>&amp;title=<?php echo urlencode(get_the_title($id)); ?>&amp;source=<?php bloginfo('name'); ?>&amp;summary=<?php the_excerpt_rss(); ?>" rel="nofollow">

                                <img alt="LinkedIn" title="LinkedIn" src="<?php bloginfo('template_url'); ?>/images/linkedin_32.png" /></a>

                            </li>

                            <?php if(function_exists('wp_email')) { ?><li><a title="Enviar por correo" href="<?php the_permalink(); ?>&amp;email=1" rel="nofollow">

                                <img alt="Envia este articulo por correo" title="Enviar por email" src="<?php bloginfo('template_url'); ?>/images/email_32.png" /></a>

                            </li><?php } ?>

                  </ul>

Tal vez algun codigo te fallo, o la URL de la imagen no es correcta.
 

Si eso creo, aun asi muchas gracias 😀
 
Emm pero cambiaste la parte que dice "url_de_boton_twitter" o "url_de_boton_facebook" por las URLs de las imágenes? Porque los códigos que te pasó están bien...