HomeWordpress

WordPress Par Custom Shortcode Kaise Banaye?

Like Tweet Pin it Share Share Email

wordpress custom shortcode

WordPress Par Custom shortcode kaise banaye?




Ji ha aap wordpress me apna khud ka custom shortcode bana sakte hain.

Ab aap yah soch rahe honge ki aakhir yah shortcode ka meaning kya hota hai?

Agar aap wordpress me new hain to shortcode ka naam to jarur suna hoga, kayi shortcode plugins available hain jinka use karke aap post me buttons, tab, icons, quotes etc add kar sakte hain.

Lekin agar aapko apna personal shortcode create karna ho to?

Main aapko yahi batane ja raha hu, kaise aap apna shortcode bana sakte hain.




But first shortcode kya hai wo samajh lete hain?

Shortcode kya hai?

Shortcode yah WordPress me added ek feature hai jiska use karke aap kisi bhi longer text or code ko single word type karke apni post me add kar sakte hain. Isko aap ek tarah se shortcut bhi kah sakte hain.

Suppose aapko koi big code ya text paragraph baar-baar post me add karna padta hai to aap usko single sa word type karke add kar sakte hain.

For instance – sabhi post ke below aapko follow me on twitter add karna hai aur aapne uska shortcode [twit] banaya hai to aap sirf [twit] shortcode ka use karke post me add kar sakte hain.

Tip: Aap adsense code ka bhi shortcode bana sakte hain aur kahi bhi sirf single word add karke ads show kar sakte hain.

How To create Custom Shortcode?

To aapne soch liya kis text or code ko baar-baar aap post me type karte hain?

Ab chaliye uska shortcode banate hain, taki baar-baar long code or text nahi type karna pade.




Yaha main follow me on twitter ka shortcode bana raha hu, taki sirf single word me yah text with link add kar saku.

1

Sabse pahle apne WordPress dashboard par Appearance » Editor par click kare.

2

Editor me right side me Theme Functions (functions.php) par click kare.

wordpress functions php

3

Function.php ke andar sabse neeche aapko below code paste karna hai.

function twitter() {
return ‘Follow me on <a href=”http://Twitter.com/askmehindi”>twitter </a>‘;

  • Above code me Red color address ki jagah apna text or code add kare.

4: Ab below code bhi add kare.

add_shortcode(‘tweet’, ‘twitter’);

  • Above code me tweet mera shortcode hai.

Ab jab main apni post me [tweet] type karunga to post me follow me on twitter show karega.

Now Save functions.php file and you are done!

Now See result

custom shortcode wordpress




Result me aap dekh sakte hain kis tarah se Post me maine [tweet] type kiya hai aur post preview karne par follow me on twitter show kar raha hai.

Bus kuch is tarah se aap kisi bhi long text or code ko single word (shortcut) se post me add kar sakte hain.

Aap Adsense ad code ka bhi shortcode above method se bana sakte hain.

Adsense Ad Shortcode

Adsense ad ka shortcode banane ke liye above method follow kare.

functions.php me below code paste karke save kare.

function adsense() {
return ‘Your Ad Code here‘;

add_shortcode(‘Ad1’, ‘twitter’);

  • Your ad code here me apna adsense ad code add kare aur Ad1 yah aapka shortcode hai jo post me [ad1] type kar use kar sakte hain.

To kuch is tarah se wordpress par custom shortcode aap bana sakte hain. Jo log aksar apni sabhi post me koi khaas text or code or link add karte hain wo iska use kar sakte hain.

Comments (2)

  • sir yhi theme maine bhi lagye hai lekin sir jo aapke theme me header me HOME BLOGGING MAKE MONEY ye sab a rha haii eski setting kaise karu sir plz step by step batye

    Reply
    • Author

      Gaurav,
      yah aap Appearance — Menu me kar sakte hain.
      Agar aap nahi kar sakte then give me account details i will do it for u

      Reply

Leave a Reply

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