Page Builder Sandwich پر کسٹم شارٹ کوڈز شامل کرنے کا طریقہ

تحریر کردہ

میں

From the word itself, the word shortcode means exactly that: A short code; a shortcut code.

شارٹ کوڈز آپ کو اپنی ویب سائٹ میں چیزیں شامل کرنے کی اجازت دیتے ہیں (مثال کے طور پر وجیٹس کی طرح)، بغیر کوڈ کے بڑے ٹکڑے شامل کیے جیسا کہ ڈویلپرز عام طور پر کرتے ہیں۔

مثال کے طور پر، لمبائی کے لحاظ سے کوڈ کا ایک عام ٹکڑا شاید کچھ اس طرح نظر آئے گا:

<html>Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Etiam id aliquam turpis. Vivamus quis arcu tincidunt, finibus urna eget, placerat risus.

Aliquam arcu massa, finibus et lacinia sed, scelerisque nec augue. Quisque eu viverra sapien, vel consequat lorem. Integer vel erat tortor.

Phasellus condimentum magna eget congue venenatis. Suspendisse blandit vehicula consectetur.

Nullam sodales eleifend massa, in bibendum purus fermentum id.

Morbi et turpis feugiat, malesuada ipsum sit amet, interdum nulla. In non ante nec nisl mattis gravida sit amet id lectus.

</html>​

اس مثال کے لیے، آئیے فرض کرتے ہیں کہ اوپر دیا گیا کوڈ کا ٹکڑا آپ کو لوریم اپسم (Lorem Ipsum) پلیس ہولڈر متن کا پورا پیراگراف شامل کرنے کی اجازت دے گا۔

Now, a shortcode with the same exact function as the code above will look something like this, in contrast:

[lorem ipsum dolor estat]Lorem Ipsum[/lorem]​

You can see how they’re miles different from each other in terms of length.

اب تصور کریں کہ کوڈ کے دونوں ٹکڑے– اصل، طویل ٹکڑا، بمقابلہ صرف لفظ "lorem” پر مشتمل شارٹ کوڈ، دونوں بالکل ایک جیسا کام کریں گے: لوریم اپسم متن شامل کرنا۔

This is what shortcodes do. They make adding widgets, functions, and a bunch of other cool stuff easier for both ordinary WordPress users and developers alike.

Where can I find shortcodes?

اگر آپ کے پاس کوئی پسندیدہ پلگ ان یا وجیٹ ہے، تو امکان ہے کہ ان کے پاس آپ کے استعمال کے لیے ایک شارٹ کوڈ دستیاب ہو۔

Shortcodes Ultimate, for example, will let you choose from hundreds of shortcodes that you can use on Page Builder Sandwich (or anywhere, actually) by simply grabbing the shortcode of your choice from Shortcode Ultimate’s repository or documentation page.

Adding Custom Shortcodes on PBS

Page Builder Sandwich پر، آپ اپنے مواد کے حصے میں صرف ٹائپ کر کے یا کاپی پیسٹ کر کے شارٹ کوڈز براہ راست اپنے صفحے پر شامل کر سکتے ہیں۔

ہم نے نیچے Shortcodes Ultimate کے شارٹ کوڈ کے ساتھ ایسا کیا ہے، جس سے Page Builder Sandwich کے ڈیمو پیج پر ایک مواد کا باکس شامل کیا گیا ہے:

Another thing you’ll find handy when using Page Builder Sandwich is our Shortcode Mapping feature.

شارٹ کوڈ میپنگ پر ہمارے پچھلے مضامین میں سے ایک کے مطابق، تعریف درج ذیل ہے:

Shortcode mapping is like letting Page Builder Sandwich memorize all the shortcodes available on your site: their names, descriptions, their attributes, and what each of these attributes do.

اس کا ایک حصہ یہ ہے کہ اب آپ کو ان کی متعلقہ دستاویزات یا ریپوزٹریز پر دستی طور پر اپنے شارٹ کوڈز تلاش کرنے کی ضرورت نہیں ہے۔

جب تک آپ کے پاس وہ پلگ ان موجود ہے جس میں شامل شارٹ کوڈ آپ کی ورڈپریس سائٹ پر انسٹال ہے، یہ آپ کے لیے Page Builder Sandwich پر استعمال کرنے کے لیے آسانی سے دستیاب ہوگا۔

So for example, if I wanted to add a WooCommerce shortcode on my page, all I have to do is make sure that it’s installed on my WordPress site, like so:

And then, to actually add the shortcode, I’ll just go to my page, and drag and drop the Shortcode Element:

Because we already have WooCommerce installed on our WordPress site, you can see that all of the shortcodes that are available on the WooCommerce plugin are already available on Page Builder Sandwich. This is what Shortcode Mapping is.

You can also see on the upper left corner that the ACF (Advanced Custom Fields) and MailChimp shortcodes are available– because we have those instlled on our WordPress site, too.

لہذا اگر آپ کسٹم شارٹ کوڈز، یا اپنے خود کے بنائے ہوئے شارٹ کوڈز شامل کرنا چاہتے ہیں، تو آپ کر سکتے ہیں، بشرطیکہ وہ آپ کی ورڈپریس سائٹ پر انسٹال ہوں۔

Here are some other helpful plugins that you can use to create your own custom shortcodes: