WordPress में Social Buttons कैसे Add करें, Without Plugins

WordPress Blogs Me Social Button Kaise Add Kare और Bina Plugin Ke Social Buttons Kaise Add Kare

क्या आप भी आपके WordPress Blogs में बिना Plugin के Social Media Buttons इस्तेमाल करना चाहते हैं? अगर हाँ, तो आप सही जगह हैं. आज हम बात करेंगे WordPress Blogs Me Social Button Kaise Add Kare और Bina Plugin Ke Social Buttons Kaise Add Kare के बारे में पूरी जानकारी.

तो चलिए शुरू करते हैं, Article पढ़ने से कि अपने Blog में Social Buttons कैसे Add करें के बारे में पढ़ने से…

Social Media Buttons Create Kaise Kare

Social Media Buttons बनाने के लिए आपको इस Code को आपके Functions.php File में Add करना है. इसके बाद आपको आपकी हर Post के निचे Social Icons देखने को मिल जाते हैं. आप इन Icons को CSS की मदद से किसी भी तरह से Customize कर सकते हैं.

function my_share_btn($content)
{
	global $post;
	
	if(is_single())
	{
	
		// Get the post's URL that will be shared
		$permalink=urlencode(get_the_permalink());
		
		// Get the post's title
		$title=str_replace(' ', '%20', get_the_title());
		
		// Compose the share links for Facebook, Twitter, Google+ and Whatsapp
		$tw = 'https://twitter.com/intent/tweet?text='.$title.'&url='.$permalink.'&via=gyanians';
		$fb = 'https://www.facebook.com/sharer/sharer.php?u='.$permalink;
		$gp = 'https://plus.google.com/share?url='.$permalink;
		$wp = 'whatsapp://send?text=*'.$title.'*'.$permalink; 

		$content.='<div class="social-box">';
		$content.='<div class="sb-title"> <i class="fa fa-share-alt" aria-hidden="true"></i> Share this Post </div>';
		$content.='<div class="fb sb-icon"> <a href="'.$fb.'" target="_blank" title="Share this post on Facebook"> <i class="fa fa-facebook" aria-hidden="true"></i> </a> </div>';
		$content.='<div class="tw sb-icon"> <a href="'.$tw.'" target="_blank" title="Share this post on Twitter"> <i class="fa fa-twitter" aria-hidden="true"></i> </a> </div>';
		$content.='<div class="gp sb-icon"> <a href="'.$gp.'" target="_blank" title="Share this post on Google Plus"> <i class="fa fa-google-plus" aria-hidden="true"></i> </a> </div>';
		$content.='<div class="wp sb-icon"> <a href="'.$wp.'" target="_blank" title="Share this post on Whatsapp"> <i class="fa fa-whatsapp" aria-hidden="true"></i> </a> </div>';
		$content.='</div>';
		
		return $content;
	}
	else
	{
		return $content;
	}
}
add_filter( 'the_content', 'my_share_btn');

WordPress Me Social Buttons Add Kaise Kare

अगर आप Gyanians की तरह, आपकी Site को Design करना चाहते हैं, तो आप नीचे दिए CSS Code को Copy करके आपकी Theme के Style.css File में Paste कर दें. फिर Update File Button पर Click करते ही आपकी File Update हो जाती है.

.social-box	{
margin-top:10px;
margin-bottom:10px;
}

.social-box .sb-title
{
	font-weight:bold;
	font-size:18px;
    margin-bottom:5px;
}

.social-box .sb-icon
{
	background-color:green;
	display:inline-block;
	padding:8px 15px;
	margin:3px;
	border-radius:50%;
}

.social-box .sb-icon a
{
	color:#fff;
}

.social-box .fb 
{
	background-color:#3b5998;
}
.social-box .fb:hover 
{
	background-color:#324b81;
}

.social-box .tw 
{
	background-color:#55acee;
}
.social-box .tw:hover 
{
	background-color:#178de8;
}

.social-box .gp
{
	background-color:#dd4b39;
}
.social-box .gp:hover 
{
	background-color:#ae2e1e;
}

.social-box .wp
{
	background-color:#4dc247;
}
.social-box .wp:hover 
{
	background-color:#3fac39;
}

WordPress Me Social Buttons Ke Shortcodes Add Kaise Kare

अगर आप Social Buttons को अपने Widget Area में या कहीं भी Add करना चाहते हैं, तो आप Shortcodes Use कर सकते हैं. Social Media Buttons का Shortcode बनाने के लिए आपको ऊपर दिए Php Code में, नीचे दिए Code को Add करना होगा.

add_shortcode('social','my_share_btn');

इस Code को Copy करके Functions.php में Paste करना है. उसके बाद आप जहाँ भी [social] Shortcode का Use करोगे, वहांपर Social Media क्र Buttons Add हो जाएंगे.

आशा करते हैं आपको WordPress Blogs Me Social Button Kaise Add Kare और Bina Plugin Ke Social Buttons Kaise Add Kare पोस्ट पसंद आई होगी.

अगर आपको इस Post से Related कोई सवाल या सुझाव है तो नीचे Comment करें. अगर आपको यह Post पसंद आई तो अपने दोस्तों के साथ जरुर Share करें.

Questions & Answer:
Off Page Seo Kya Hai और Off Page Seo Kaise Kare

Off Page SEO क्या है, ऑफ़ पेज एसईओ कैसे करें, 9 आसान तरीके

SEO
WordPress Me Logo Kaise Lagaye और WordPress Theme Development From Scratch

WordPress में LOGO कैसे लगाए, Theme Responsive कैसे बनाएं

WordPress
Instagram Kya Hai और Instagram Account Kaise Banaye

Instagram क्या है, Instagram Account कैसे बनाएं, Bio क्या लिखें

Apps
Author :
सु-सुवागातम Gyanians इस वेबसाइट का मकसद है लोगो को हिंदी भाषा में ज्ञान प्रदान करना उनके द्वारा पूछे गए प्रिश्नों के उत्तर देना और यह कार्य करने के लिए हम तात्पर्य है. आप Gyanians को लोगों के साथ शेयर करके हमारी सहायता कर सकते है .
Questions Answered: (35)

    Email par contact karo .. main teamviwer se live css set kar dunga ~

      Mukesh Gupta says:

      Thik ho gya direct theme folder me dalne se work nhi kar rhi.. Apprence > customize > additional css me dalne se work kar rhi hai.. Anyway maine css thodi customize ki hai aap dekh ke batao kaisi hai.

        Muje black outline acchi nhi lag rahi .. vaaki aapne accha customize kia hai ~

          Mukesh Gupta says:

          Ty for suggesting ise abhi remove kar deta hoon ????

sourav says:

sir main code copy paste kiya hai.but jo pahle tha share button wahi wala abhi bhi hai.usko remove krna hoga kya.agar haa to kaise .plz bataye

    Sbse pehle ye dekhiye ki old share button plugin se hai ya built in …agr built-in hai to aapko ye code lagane ki jarurt nhi hai ~

sir please mai ek new wordpress user hu mujhe ye btaye ki site ki loading speed kaise badhau mai jetpack, yoast seo, wp optimize aur quick adsense plugin use krta hun please aap ye batayen ki site ki loading speed kaise badhau ek baar mere site ki loading spped bhi check kar len

    Aap sbse pehle jetpack ko remove kar dijiye aapki speed 2.50s se jyada hai .. jetpack remove karte hi 2s ke ander ho jayegi ~

      sir maine ek hosting provider se bat kiya to wo bole ki jetpack use kijiye aur maine compare bhi kiya jo jetpack use nahi krta hai usse to meri site ki loading speed 1.6 s btayi seooptimer me to kya phir bhi mujhe jetpack htana chahiye. aur dusri bat kya aap cdn use krte hai mujhe bhi use krna chahiye

        Nahi fir aapko jarurat nhi hai.. web speed 2.s ke ander hai ….

sandeep says:

sir ji blogger ke liye koi upaay hai to please share kare

Leave a Reply

Your email address will not be published. Required fields are marked *