After our article recommending users to stop using Feedburner, many users asked us how they can get social share buttons like they had on their FeedBurner feeds. While most modern feed readers include social sharing capabilities, in this article, we will show you how to add social buttons to your WordPress RSS feed.
The first thing you need to do is download the social buttons you want to display on your feeds. There are various sets of social media icons available for free. Choose one that best suits your needs. After that you have to go to Media »Add New and upload Facebook and Twitter icons to your media library.
Once you have uploaded the icons, you will need to copy the URL of their location. Simply go to Media library and click the Edit link below the Twitter icon.
On the Edit Media page, copy the URL of the file and paste it into a text editor. Repeat the process for the Twitter icon as well. We will need these URLs later.
We will use the default WordPress content filter to add these icons below each post in your WordPress RSS feed.
You need to add this code in your theme's functions.php file or in a site-specific plugin.
// agregar la función de contenido de la fuente personalizada wpb_add_feed_content ($ content) // Verificar si se solicita una fuente si (is_feed ()) // Enlace de publicación de codificación para compartir $ permalink_encoded = urlencode (get_permalink ()); // Obtención del título de la publicación para el tweet $ post_title = get_the_title (); // Contenido que desea mostrar debajo de cada publicación // Aquí es donde agregaremos nuestros íconos $ contenido. = ''; devolver $ contenido; add_filter ('the_excerpt_rss', 'wpb_add_feed_content'); add_filter ('the_content', 'wpb_add_feed_content');
This code simply adds HTML to display the social icons below the content of WordPress RSS posts.
We hope this article has helped you add social buttons to your WordPress RSS feeds.
If you liked this article, please subscribe to our YouTube channel for our WordPress video tutorials. You can also find us on Twitter and Google.+.