WordPress Customizer API - Editable Sections / Theme Development

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.ค. 2024
  • 💰 20% Referral Hosting Discount: www.hostg.xyz/SHEiZ
    If you are currently developing your own WordPress Theme and you want to make it fully customizable, the WP Customizer API is a great option to get started. In this tutorial, I will show you how to create a Customizer Class and use the WP Customizer API to add and retrieve data without doing any complicated database queries. I will cover how to add the Select option, Textarea and Image.
    Article: www.raddy.dev/blog/wordpress-...
    ☕ BuyMeACoffee: www.buymeacoffee.com/RaddyThe...
    Discounts:
    ⚡ Hostinger: www.hostg.xyz/aff_c?offer_id=...
    ⚡ Elementor: be.elementor.com/visit/?bta=2...
    Recording Equipment:
    ◾ Microphone: amzn.to/3Ppp8Ok
    ◾ Shotgun Mic: amzn.to/3IVqIot
    ◾ Camera: amzn.to/3z0bxpF
    ◾ Lens: amzn.to/3Pw4s7d
    ◾ Lighting: amzn.to/3PGXvzW
    Computer Gear:
    ◾ Keyboard: amzn.to/3PGXvzW
    ◾ Headphones: amzn.to/3PJl9fg
    ◾ Mouse: amzn.to/3z1TGPf
    Connect with me:
    ◾ Website: www.raddy.dev
    ◾ Newsletter: www.raddy.co.uk/newsletter

ความคิดเห็น • 86

  • @ChristineLGolden
    @ChristineLGolden 4 ปีที่แล้ว +1

    Wow! So generous of you to share this! It's just what I needed, too.

    • @RaddyDev
      @RaddyDev  4 ปีที่แล้ว

      I hope that you found it useful. Thank you for watching and thank you for the nice comment 🙂

  • @aurea_libertas
    @aurea_libertas 3 ปีที่แล้ว +1

    Great tutorial! This is just what I was looking for. Thanks!

    • @RaddyDev
      @RaddyDev  3 ปีที่แล้ว

      Thank you!

  • @nataliaregina5458
    @nataliaregina5458 2 ปีที่แล้ว +1

    Very helpful! Thank you! I would like to see more videos like this.

    • @RaddyDev
      @RaddyDev  2 ปีที่แล้ว

      Glad it was helpful! I do have a few video ideas in mind

  • @jonesmichael7799
    @jonesmichael7799 2 ปีที่แล้ว +1

    This is what I needed. Thanks for posting!

    • @RaddyDev
      @RaddyDev  2 ปีที่แล้ว

      Thank you for watching, Jones!

  • @masdejorge-jorgemolinasoto9724
    @masdejorge-jorgemolinasoto9724 3 ปีที่แล้ว +1

    Gracias por este tutorial, me ha servido de grán ayuda, gracias por compartir su sabiduría

    • @RaddyDev
      @RaddyDev  3 ปีที่แล้ว

      Gracias por el comentario amigo!

  • @Mychelonn
    @Mychelonn 4 ปีที่แล้ว

    Excellent video. Straight to the point.

    • @RaddyDev
      @RaddyDev  4 ปีที่แล้ว

      Thank you!

  • @misters6451
    @misters6451 3 ปีที่แล้ว +1

    Thank you!!! Great tutorial!!!

    • @RaddyDev
      @RaddyDev  3 ปีที่แล้ว

      Glad you liked it! Thank you

  • @tanyarix
    @tanyarix 4 ปีที่แล้ว

    Thank you, RaddyTheBrand

    • @RaddyDev
      @RaddyDev  4 ปีที่แล้ว

      Thank you, Tanya!

  • @MrJonwarde
    @MrJonwarde 3 ปีที่แล้ว

    Great video - thanks for sharing!

    • @RaddyDev
      @RaddyDev  3 ปีที่แล้ว

      Thanks, Jon! I appreciate the comment

  • @josemedina7507
    @josemedina7507 3 ปีที่แล้ว

    Thank you so much for this video!

    • @RaddyDev
      @RaddyDev  3 ปีที่แล้ว

      You are so welcome!

  • @jewenellearchide7272
    @jewenellearchide7272 4 ปีที่แล้ว

    thank you man for making this video

    • @RaddyDev
      @RaddyDev  4 ปีที่แล้ว

      Thank you for watching!

  • @nirajgautam403
    @nirajgautam403 ปีที่แล้ว

    Easy to understand . Thanks bro !

    • @RaddyDev
      @RaddyDev  ปีที่แล้ว

      Always welcome

  • @bazylissatheophanu
    @bazylissatheophanu 3 ปีที่แล้ว

    This was reaaally helpful!

    • @RaddyDev
      @RaddyDev  3 ปีที่แล้ว

      Thank you! 👊😎

  • @putraprawira6853
    @putraprawira6853 3 ปีที่แล้ว

    Thanks for your helpful tutorial bro

    • @RaddyDev
      @RaddyDev  3 ปีที่แล้ว

      Thank you for watching!

  • @HRaza143
    @HRaza143 3 ปีที่แล้ว

    I want to slap on the face of those 7 people who disliked this video. Awesome work man, I was looking for this for the last 4-5 hours. 👏👏👏👏👏

    • @RaddyDev
      @RaddyDev  3 ปีที่แล้ว +1

      Thank you so much! haha yeah, I'll RKO them 😂😂😂

    • @HRaza143
      @HRaza143 3 ปีที่แล้ว

      @@RaddyDev Do you know how we can add "visible edit shortcuts" with customization? Obviously, you would know 😊 do you have any video on it?

    • @RaddyDev
      @RaddyDev  3 ปีที่แล้ว

      ​@@HRaza143 Hmmm I know that the button appears on some of the editable sections automatically. Like on the logo I remember having it there, but I haven't looked into how to make all of them have the edit button. It never crossed my mind, to be honest

  • @AM2VISUALS
    @AM2VISUALS 4 ปีที่แล้ว

    Very nice tutorial

    • @RaddyDev
      @RaddyDev  4 ปีที่แล้ว

      Thank you! 🦍

  • @binaryfire
    @binaryfire 4 ปีที่แล้ว

    Hey Raddy, I've got a page which is styled by a plugin. The style values (colours, typography etc) are stored in the plugin's wp_options settings. I want to create a customizer section for the plugin so I need to update those wp_options values when the controls for that section are changed. I.e. changing the font colour in the customizer needs to update the plugin's wp_options value for font colour. Also, the live preview pane needs to refresh as normal and show the updated styling. Do you know how I could do that? Maybe using some kind of control action hook?

    • @RaddyDev
      @RaddyDev  4 ปีที่แล้ว +2

      Why can't you use the same method I used on this video?
      Just make sure that the options only appear in the customizer when the plugin is enabled

  • @alexmassy
    @alexmassy 3 ปีที่แล้ว +2

    Thx ! amazing tutorial. Is there a way to register multiple Customizer using this class ?

    • @RaddyDev
      @RaddyDev  3 ปีที่แล้ว +1

      I believe that you only have one customizer on WordPress. You can create multiple classes or functions to add functionality to it, but I am not sure about creating multiple customizers

    • @alexmassy
      @alexmassy 3 ปีที่แล้ว

      @@RaddyDev Oh yeah. Thank you! I was looking at the problem the wrong way. Your solution should work perfectly for me. 🔥

  • @MehmetBOZKURTEvil
    @MehmetBOZKURTEvil 3 ปีที่แล้ว

    thank you

    • @RaddyDev
      @RaddyDev  3 ปีที่แล้ว

      Thank you for watching!

  • @roshaneforde
    @roshaneforde 4 ปีที่แล้ว

    Thanks. It would be helpful if you could create a gist or repo for the code in the tutorial too. Thanks again.

    • @RaddyDev
      @RaddyDev  4 ปีที่แล้ว +1

      The code is on my blog but I totally forgot to paste the link in the description. Thank you and here is the link:
      www.raddy.co.uk/blog/wordpress-customizer-api-editable-sections-theme-development/

  • @lowtianwei9722
    @lowtianwei9722 ปีที่แล้ว

    Thanks. it's useful for me. How can I add blue pen edit icon at each section?

    • @RaddyDev
      @RaddyDev  ปีที่แล้ว

      i don't know on top of my head, it's been a long time since I looked into this. Look online, maybe even in the documentation for the customizer

  • @RajibAhmad
    @RajibAhmad 3 ปีที่แล้ว +1

    please do the social section as well.... great tutorial
    ...

    • @RaddyDev
      @RaddyDev  3 ปีที่แล้ว

      I did do something like this, but I am not sure if I recorded it on video. I'll have to check. Thanks for the comment!

  • @baco82
    @baco82 4 ปีที่แล้ว

    I'm just a bit confused about sanitize_callback. Why you assign an array? I can't find other examples.

    • @RaddyDev
      @RaddyDev  4 ปีที่แล้ว +1

      There must be a reason for this madness, but now that I look at it I am not so sure. Maybe just call the function instead and yes there are not many examples on this which is a shame. You don't have to have the sanitize callbacks, but it's obviously good practice

  • @RP-te5xc
    @RP-te5xc 3 ปีที่แล้ว +1

    sir thank u thank u
    but i want to create font-family option using customizer setting control plz guide me create these typography ,
    Best regards

    • @RaddyDev
      @RaddyDev  3 ปีที่แล้ว

      You could use the Google / Adobe Fonts API to list the fonts in a drop down menu or whatever works for your project. The API should return pretty much everything that you need. If you only need two or thee fonts the I guess you can list them manually to save you the trouble of doing it with the Google APi

  • @eroopie-qh5mh
    @eroopie-qh5mh ปีที่แล้ว

    how to create new sections by user ( i need for my slider )

  • @yugsavaliya4244
    @yugsavaliya4244 7 หลายเดือนก่อน

    Really nice video very helpful tutorial.
    But How can I dreg and drop ordering section in home page ?
    Please kindly response 🙏

    • @RaddyDev
      @RaddyDev  7 หลายเดือนก่อน

      Like if you used something like Elementor? That would require quite a lot of work I think. Some JS for the drag and drop functionality and potentially an API to save the data. If anybody has a clear idea how to do this, please share :)

  • @theman7050
    @theman7050 2 ปีที่แล้ว

    Thank. But is this not possible in procedural programming? I have no idea about OOP yet.

    • @RaddyDev
      @RaddyDev  2 ปีที่แล้ว +1

      It's totally possible. You can split everything into functions and that would work too. There must be a lot of examples on the web

    • @theman7050
      @theman7050 2 ปีที่แล้ว

      @@RaddyDev thx

  • @bibek_shrestha
    @bibek_shrestha 4 ปีที่แล้ว

    Thank you! make another video in customizer please

    • @RaddyDev
      @RaddyDev  4 ปีที่แล้ว +1

      Thanks for watching! Anything specific?

    • @bibek_shrestha
      @bibek_shrestha 4 ปีที่แล้ว

      Maybe covering more functions parameters of add_settings and sections

    • @bibek_shrestha
      @bibek_shrestha 4 ปีที่แล้ว

      @@RaddyDev and thanks for replying. Your teaching style is great
      Love from nepal 🥰

  • @piotrdeja4329
    @piotrdeja4329 3 ปีที่แล้ว

    Why did you use that extra function 'restister_customize_sections' inside __construct. Is it possible to use 'author_callout_section' instead of 'restister_customize_sections' in __construct ?
    If no, why ?

    • @RaddyDev
      @RaddyDev  3 ปีที่แล้ว

      It's been a while since I've looked at the code. It was just to group the sections for maintainability. You definitely don't need to do it this way. You can wrap your sections in separate functions and that would also work

    • @piotrdeja4329
      @piotrdeja4329 3 ปีที่แล้ว

      ...ok I needed to isntantiate the object by: new CustomizerField; -> now it does work

  • @MuhammadAdnan-gx6rd
    @MuhammadAdnan-gx6rd 4 ปีที่แล้ว

    Great. ..

    • @RaddyDev
      @RaddyDev  4 ปีที่แล้ว

      Thank you! 🦍

    • @MuhammadAdnan-gx6rd
      @MuhammadAdnan-gx6rd 4 ปีที่แล้ว

      @@RaddyDev go advance. ..

    • @RaddyDev
      @RaddyDev  4 ปีที่แล้ว +1

      @@MuhammadAdnan-gx6rd What do you mean?

    • @MuhammadAdnan-gx6rd
      @MuhammadAdnan-gx6rd 4 ปีที่แล้ว

      @@RaddyDev I mean to say develop mega menu to show feature image and title of posts + with user input not required but nice to have for customizing api ?

  • @avinavaggarwal4713
    @avinavaggarwal4713 4 ปีที่แล้ว +1

    Hello sir, i want some help of yours. I have jdoodle API and i want to add in wordpress. Can you help me to integrate jdoodle compiler in my website via APi??

    • @RaddyDev
      @RaddyDev  4 ปีที่แล้ว

      Hey, I've never heard of it. I just looked on GitHub and there is a WP plugin that you can download and try

    • @avinavaggarwal4713
      @avinavaggarwal4713 4 ปีที่แล้ว

      @@RaddyDev ok thanks.. and one thing more can you help me in creating a custom widget for Website?

    • @RaddyDev
      @RaddyDev  4 ปีที่แล้ว

      @@avinavaggarwal4713 What are you struggling with?

    • @avinavaggarwal4713
      @avinavaggarwal4713 4 ปีที่แล้ว

      @@RaddyDev sir i want to add a online compiler on my website. And i have api and widget code both but don't know how to install that on my website. ... Pls pls pls help if you can 🙏

    • @RaddyDev
      @RaddyDev  4 ปีที่แล้ว

      Send me an email with the details, but also be consise as I don't have a lot of time. hello@raddy.co.uk

  • @awaisrajpoot3160
    @awaisrajpoot3160 3 ปีที่แล้ว

    what if we want to use it for a plugin?

    • @RaddyDev
      @RaddyDev  3 ปีที่แล้ว

      I don't see a problem. Just use it :-)

  • @stefanygonzalez1881
    @stefanygonzalez1881 ปีที่แล้ว

    how can i put an image as a default ?

    • @RaddyDev
      @RaddyDev  ปีที่แล้ว

      Something like this might do the job
      if ( $theImage ) { echo $theImage }
      else {
      echo '';
      }

  • @evgeniydoronin
    @evgeniydoronin 4 ปีที่แล้ว

    subscriber 666 )) Thanks!

    • @RaddyDev
      @RaddyDev  4 ปีที่แล้ว +1

      🤘👿🤘 Thank you for subscribing!