Mbrsolution

Web Developing / Computer Repairs Brisbane
  • Home
  • Blog
  • Comment subscriptions
  • Contact Mbrsolution
  • Search My Site
  • Web Tutorials
    • Joomla Tutorials
    • KompoZer Tutorials
    • WordPress CMS Tutorials
      • WordPress Plugins Tutorials
        • WordPress Fast Secure Contact Form Plugin
        • WP CataBlog Plugin Tutorials
      • WordPress Theme Tutorials
        • Template Toaster Software WordPress
        • Suffusion Theme Tutorials
  • WordPress Web Site Design
Home » WordPress » Social Media Share Buttons For Twitter Facebook

Social Media Share Buttons For Twitter Facebook

 WordPress
Jun 182014
 

Social Media Share Buttons For Twitter Facebook post shows you how to display the social sharing buttons for Facebook and Twitter in post and more.

Last Updated: June 24, 2019

Latest News: I updated the information below.

The plugin that I will be using is from Tips And Tricks HQ. They have released a very simple and effective Social Sharing Plugin that uses very little resources.

The code and information is obtained from codex.wordpress.org.

What You Need:

  • Fat Free WordPress Social Share Buttons Plugin
  • Page from wordpress.org Conditional_Tags#The_Front_Page (Optional to read)

Social Media Share Buttons For Twitter Facebook

The plugin will display Twitter and Facebook on your blog post. What if you want to add and modify the code so that it displays on pages, blog post, front page or other places?

Step 1 ) Install the plugin as you normally install a plugin in WordPress. The plugin has no settings to configure. So it is a simple installation and activation process.

Step 2 ) FTP into your server and locate your plugins directory. Find the following plugin folder gfts-share-buttons. Locate inside the following file gfts_share_buttons.php and download it locally via FTP.

social-media-sharing-buttons-google-twitter-facebook-file

Note: If you don’t want to FTP into your server for what ever reason. You can always edit the file from your website. Log in as admin and click on the following Plugins -> Editor. Locate and edit the plugin file. Make sure you save your settings.

Step 3 ) Open the file using a text editor or a php editor. Locate the following if(is_single()) and replace it with the following code. See image below.

Understanding The Code

What it all means:

The following if (is_single()) //Load these in the single post view only. This is a very simple explanation.

New code to add if (is_single() || is_front_page ()) in the two locations as shown below. This will display the social media buttons on a single post and also on the front page as well.

social-media-sharing-buttons-google-twitter-facebook-code

Important: Once you finish editing your file, save and upload the file to the same location on your server.

The code above is to prevent the social media buttons from appearing on all pages like your Contact Us page.

What if you want it to appear on certain pages?

A Single Post Page

is_page( ’17’ ) //When Page 17 is being displayed.
is_single( ‘Irish Stew’ ) //When the Post with Title “Irish Stew” is being displayed as a single Post.

From the above code you can see how easy it is to display the social media buttons on certain pages. Search for all the pages where you would like the social media buttons to appear and add them as you see in the example above.

If you wanted to display the buttons on more than one page then you would use the following code.

is_page( array( 17, 19, 1, 11 ) )

(Note: Remember that your pages ID number will be different )

Step 4 ) The following image displays the social buttons on a page or post.

social-media-sharing-buttons-twitter-facebook-display

If you need to find how to add different functions, click on the following URL Function Reference from wordpress.org.

That is how simple it is to modify the code in this great little plugin. I will be updating this post from time to time. If you have any questions please let me know.

Enjoy.

Share this post:

Share on Twitter Share on Facebook Share on Pinterest Share on LinkedIn Share on Email
I have been working in IT since 1999 and I enjoy the challenges it brings me. I love developing websites with WordPress. I spend a lot of time helping out in wordpress.org forums. I have been writing tutorials since 2011. Now I am learning how to manage my own VPS "Virtual Private Server.
 Tagged with: Facebook, social sharing, tutorial, twitter

 Leave a Reply Cancel reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

two × one =

  Fast Secure Contact Form Two Columns Layout   Photonic Generic Options

Follow Me

Mbrsolution Facebook Mbrsolution RSS Feed Mbrsolution Twitter

Spanish Blog

Blog in Spanish


Blog Español

Recent Posts

  • MailPoet Wizard Setup
  • Translate Simple Membership Using Loco Translate
  • The SEO Framework Webmaster Meta Settings
  • WP The SEO Framework Schema Settings
  • AIOWPS Two Factor Auth Settings

Recent Comments

  • Webmaster on CCleaner Options Settings
  • Nancy Brassert on CCleaner Options Settings
  • Webmaster on WordPress Simple Membership Email Settings
  • Nuu on WordPress Simple Membership Email Settings
  • Webmaster on ClassiPress WordPress Theme Customize Footer Area
Your information will be used to send you Blog updates. You can change your mind at any time by clicking the unsubscribe link at the bottom of any email that you receive from me. You can find details about mbrsolution privacy practices here.

Advertisements

Premium WordPress Apps

Pages

  • About Mbrsolution
  • Blog
  • Comment subscriptions
  • IT and SEO Support Rates
  • Links
  • PC Tips and Tricks For Windows OS
  • Portfolio
  • Recommended Tools For Windows OS
  • Resume
  • Sitemap
  • Testimonials
  • Website Design Tools And Utilities
  • WordPress Web Site Design
  • WordPress Websites SEO Management
  • WordPress Plugins Tutorials
  • WordPress Theme Tutorials

Tutorials

  • Comment subscriptions
  • Facebook Security Tutorials
  • Gimp Tutorials Latest Version 2.10.30
  • Google Tutorials
  • How To Operate An Android Smartphone
  • PayPal Tutorials
  • Selling And Buying eBay Tutorials
  • YouVersion Bible Tutorials
  • WordPress Plugins Tutorials
  • WordPress Theme Tutorials

Buy Me Coffee!

If you find my site helpful, you can buy me a cup of coffee. Click on the following image.
Thank you for your visit, enjoy my site.
© 2009 - 2023 Mbrsolution All Rights Reserved Please read the following:

Terms And Conditions

Privacy Policy

Disclaimer

Copyright Notice.

Suffusion theme by Sayontan Sinha
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT