How to Create a Shortcode in WordPress
Learn step-by-step how to create a WordPress shortcode. Start your WordPress website with Hostinger web hosting ? https://bit.ly/3uazx8b
? Use the discount code WP10 to get 10% OFF!
This WordPress shortcode tutorial demonstrates all the steps to create a shortcode in your WordPress website. All the necessary code snippets are available in the description below – note that the process requires some coding knowledge.
____________________________________________
? Get our eBooks!
Build Your First Website in 9 Easy Steps: https://bit.ly/3Ce2i4V
Speed up Your Website: 8 Practical Tips that Work: https://bit.ly/3F5HRsK
___________________________________________
? Handy links
How to Create a Shortcode in WordPress (In 7 Steps): https://www.hostinger.com/tutorials/create-a-shortcode-in-wordpress
____________________________________________
⭐ Follow Us ⭐
TikTok: https://www.tiktok.com/@hostingeracademy
Twitter: https://twitter.com/Hostinger
Facebook: https://www.facebook.com/Hostinger/
WordPress Explained Group: https://www.facebook.com/groups/wpexplained
Hostinger Tutorials: https://www.hostinger.com/tutorials
Subscribe to our channel: https://www.youtube.com/c/HostingerAcademy?sub_confirmation=1
____________________________________________
? Timestamps
00:00 - Intro
00:11 - What is WordPress shortcode
01:21 - Creating a shortcode function
03:06 - Adding shortcode functionality
04:12 - Creating an enclosing shortcode
04:35 - Outro
___________________________________________
A WordPress shortcode is a small piece of PHP code that allows you to quickly add elements to your website’s page and post.
There are six default WordPress shortcodes:
? Audio
? Playlist
? Gallery
? Video
? Embed
? Caption
However, you can also create new shortcodes to help you publish articles faster and more efficiently. So, let’s see how to create a custom WordPress shortcode.
1️⃣ Create a New Theme File
? Access a File Manager or FTP client and create a custom-shortcodes.php file inside your theme’s directory. Add the necessary block of code.
? Save changes and delete the local file option. Then, add the code at the bottom of the functions.php file.
2️⃣ Create the Shortcode Function
? Open the custom-shortcode.php file and insert the desired action. In this video, we’re adding social media links to a post.
Right after that, add a callback function so WordPress knows the action is a shortcode:
3️⃣ Test the Custom Shortcode
? Create a new post on your WordPress website and insert the custom shortcode:
[subscribe]
4️⃣ Add Parameters to the WordPress Shortcode
? Open the custom-shortcodes.php file and add a code snippet so that you can customize the links within the shortcode tag.
5️⃣ Test the Parameters
? Let’s test the parameters by adding the shortcodes to your WordPress post.
6️⃣ Create an Enclosing WordPress Shortcode
? Open your custom-shortcode.php file and add the necessary lines of code
7️⃣ Add the Enclosing Shortcode to the Website
? For the Facebook anchor text:
[subscribe link='https://www.facebook.com/Hostinger/']Facebook[/subscribe]
? For the Twitter anchor text:
[subscribe link='https://twitter.com/Hostinger?s=20/']Twitter[/subscribe]
Watch our WordPress shortcode tutorial to see the shortcode’s final result. If you would like to check out the exact code snippets we used, visit the tutorial How to Create a Shortcode in WordPress: https://www.hostinger.com/tutorials/create-a-shortcode-in-wordpress
________________________________________
▶ Want to see more awesome tutorials like this one in the future? Consider subscribing ?
https://www.youtube.com/c/HostingerAcademy?sub_confirmation=1
▶ If you have questions, don’t hesitate and join our Facebook group for more help:
https://www.facebook.com/groups/wpexplained
____________________________________________
Thank you for watching! Let us know in the comments below if you have any questions. Good luck on your online journey. ?
#WordPressShortcode #WordPressShortcodeTutorial #HostingerAcademy
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «How to Create a Shortcode in WordPress», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.