WordPress Me Bina Plugin Ke Social Media Sharing Button Kaise Add Kare

 rdPress Me Social Media Sharing Button Kaise Add Kare



gagan62842p@gmail.com

WordPress Me Bina Plugin Ke Social Media Sharing Button Kaise Add Kare


WordPress me bina plugin ke social media sharing button add karne ke liye, aapko apne theme ke functions.php file me kuch code add karna hoga. Yeh code aapko social media sharing ke button add karne me madad karega. Niche diye gaye steps ko follow kare:


Sabse pehle apne WordPress dashboard me login kare aur Appearance > Theme Editor par click kare.


Theme Editor me functions.php file par click kare.


Ab aapko functions.php file ke end me niche diye gaye code ko add karna hoga:


php

Copy code

function add_social_media_icons() {

    if ( is_single() ) {

        ?>

        <div class="social-icons">

            <a href="https://www.facebook.com/sharer/sharer.php?u=<?php the_permalink(); ?>" target="_blank"><i class="fab fa-facebook"></i></a>

            <a href="https://twitter.com/intent/tweet?url=<?php the_permalink(); ?>" target="_blank"><i class="fab fa-twitter"></i></a>

            <a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php the_permalink(); ?>&title=<?php the_title(); ?>&summary=&source=" target="_blank"><i class="fab fa-linkedin"></i></a>

        </div>

        <?php

    }

}

add_action( 'wp_footer', 'add_social_media_icons' );

Code me di gayi social media icons me Facebook, Twitter aur LinkedIn ke link diye gaye hai. Aap chahe to inhe apne hisab se badal sakte hai.


Code me di gayi CSS class "social-icons" se icons ko CSS ke zariye style diya jaa sakta hai.


Ab aapko Update File par click karke functions.php file ko save karna hoga.


Ab aapke WordPress website ke single post me social media sharing buttons add ho chuke honge. Agar aapko abhi bhi kisi step me koi pareshani ho to aap ek web developer se madad le sakte hai.

Comments

Popular posts from this blog

PM Modi a versatile genius who thinks globally and acts locally: Justice Mishra

How to start a Kitchen Blog

Redmi Note 8 is now more expensive: You can thank CoronavirusXiaomi has increased the price of the Redmi Note 8 in India due to issues in the supply chain. The price rise is temporary.