WordPress Shortcode Tutorial: How to Create Custom WP Shortcode with PHP/HTML/CSS

Поділитися
Вставка
  • Опубліковано 25 гру 2024

КОМЕНТАРІ •

  • @omniversal4739
    @omniversal4739 4 роки тому +2

    I use sprintf when I return bunch of variables, it's easier than concatenating. I'm not saying that I'm bad at concatenating strings with variables, but it often leads to typos which therefore lead to errors, plus, I think the code actually becomes much cleaner when I use sprintf.

    • @RayDelVecchio
      @RayDelVecchio  4 роки тому +1

      Good tip. With PHP I've spent almost no time looking outside of what I need to accomplish in the moment, so each time I dig into it, I find alternative ways to do things which are more efficient or easier to maintain.

  • @jacksondmit
    @jacksondmit 4 роки тому +1

    Ray, this is a great tutorial! Thank you so much!

    • @RayDelVecchio
      @RayDelVecchio  4 роки тому

      Glad it was helpful!

    • @YashvirGaming
      @YashvirGaming 4 роки тому

      @@RayDelVecchio Hello bro, nice content, BTW i know im out of nowhere, but can you point me to a plugin or how to make a shortcode of [hide] your text here [/hide] tried this on wordpress it doesn't seem to work, only [spoiler] is working. Well I want to force users to leave a comment on my posts then refresh page to see the posts. Any ideas how to implement that hide tags in Wordpress.

  • @Love_laugh_happy
    @Love_laugh_happy 3 роки тому

    Amazing thanks for this

  • @PB72UK
    @PB72UK 4 роки тому +2

    When using a tenory function you don't need to check if it's true , as your already basically saying if it's truthy do this, else do this... @9:00

    • @RayDelVecchio
      @RayDelVecchio  4 роки тому

      Thanks for the tip. I think I wasn't sure if the "true" would get interpreted as a string or boolean value.

    • @PB72UK
      @PB72UK 4 роки тому

      Ray DelVecchio well any valid string is true by its nature.... Apart from an empty string which is falsey, so you just have to be careful when setting things as strings and not a true Boolean .. consider "false" is it Boolean false? No it's actually Boolean true... So if using strings for true and false you have to tread carefully ...

  • @irukumarasiri
    @irukumarasiri 4 роки тому

    How can I use this code for blogger... Plz help me...

  • @Anutechtrwebgodz
    @Anutechtrwebgodz 5 років тому +1

    thanks for this

  • @akshaykashyap7473
    @akshaykashyap7473 4 роки тому

    If I am not a developer and this is my first experience with short code , How should I initiate with learning it.

  • @MatrixMaster777
    @MatrixMaster777 6 років тому +1

    Awesome^^

    • @RayDelVecchio
      @RayDelVecchio  6 років тому +1

      Glad you liked it!

    • @YashvirGaming
      @YashvirGaming 4 роки тому

      @@RayDelVecchio Hello bro, nice content, BTW i know im out of nowhere, but can you point me to a plugin or how to make a shortcode of [hide] your text here [/hide] tried this on wordpress it doesn't seem to work, only [spoiler] is working. Well I want to force users to leave a comment on my posts then refresh page to see the posts. Any ideas how to implement that hide tags in Wordpress.

  • @kazadix2
    @kazadix2 5 років тому +1

    FYI @14:40 they're called pseudo-classes

    • @RayDelVecchio
      @RayDelVecchio  5 років тому

      Thanks - I'm good at remembering the syntax, and terrible at remembering the correct terminology!

    • @YashvirGaming
      @YashvirGaming 4 роки тому

      @@RayDelVecchio Hello bro, nice content, BTW i know im out of nowhere, but can you point me to a plugin or how to make a shortcode of [hide] your text here [/hide] tried this on wordpress it doesn't seem to work, only [spoiler] is working. Well I want to force users to leave a comment on my posts then refresh page to see the posts. Any ideas how to implement that hide tags in Wordpress.

  • @ladellp5135
    @ladellp5135 3 роки тому +1

    Is there anyone out there who offers information on how to edit a form or a page done with a shortcode? I put in the search bar "How to edit something already done in a shortcode format" All I get is how to create or use a shortcode. It's extremely frustrating. I use the elementor platform. Thank you in advance.

    • @RayDelVecchio
      @RayDelVecchio  3 роки тому +1

      That's a bit more difficult, because you need to find the code that controls the shortcode. It's likely embedded within your plugin in a PHP file. Normally the shortcode creator provides options for customizing through attributes or hooks/filters that can be added to the functions file like in this tutorial. You have to look into the documentation if it's an Elementor shortcode and see how/if they let you customize the way you want.

    • @ladellp5135
      @ladellp5135 3 роки тому +1

      @@RayDelVecchio Thank you so much for that info. I now officially hate shortcodes.

    • @RayDelVecchio
      @RayDelVecchio  3 роки тому

      We often hate what we don't understand, haha. Like everything with WordPress, you're limited by the developer of the theme/plugins you choose. They select the options to customize. So you need to either find a different solution or DIY. There is no platform that is "infinitely customizable" with a few clicks.

  • @andreipunei6728
    @andreipunei6728 4 роки тому +1

    You could just assign $atts[reply] so it would evaluate to true...