How to create a WordPress Page Template in a plugin

Sdílet
Vložit
  • čas přidán 5. 09. 2024

Komentáře • 31

  • @jherbison
    @jherbison  Před 2 lety +4

    This is very helpful on all sites. We do this even if we built the theme to keep the templates with the plugin.

  • @PetrVr
    @PetrVr Před rokem +1

    Saved ton of googling. Thank you!

    • @jherbison
      @jherbison  Před 11 měsíci

      Awesome! Thank you for watching and commenting.

  • @faze7574
    @faze7574 Před 2 lety +1

    that was awesome! save me hours of searching.
    thank you man, awesome job. ♥

  • @eduardpocnet1274
    @eduardpocnet1274 Před rokem +1

    Amazing tutorial! Thank you

    • @jherbison
      @jherbison  Před rokem

      You’re welcome. Thank you for watching and commenting.

  • @slow_start
    @slow_start Před 2 lety

    Very helpful. Thank you!

  • @alex-6854
    @alex-6854 Před 9 měsíci +1

    very useful , tnx

    • @jherbison
      @jherbison  Před 9 měsíci

      Awesome.. Thank you for watching and commenting.

  • @paulcodes
    @paulcodes Před 2 lety +1

    Thanks for posting this. Perfect timing as well. A client just asked me if I could build them some landing page templates. :D

    • @jherbison
      @jherbison  Před 2 lety +1

      Nice.. The great thing is, it really doesn't even have to connect to WordPress. It can be a fully stand alone html file. I saw your channel and subscribed.....

    • @paulcodes
      @paulcodes Před 2 lety +1

      @@jherbison Too kind! I haven't posted in a while. Technically I can just add HTML pages directly into the files but the client wants to be able to create their own and they have no coding experience. I like your idea with the plug in but I suppose I'd have to add some custom fields. I'm curious... Without making you feel like tech support lol... how would you approach that?

    • @jherbison
      @jherbison  Před 2 lety +1

      No problem. As much as I hate to say it, a page builder would be best. I really don’t like them, but that would be the easiest solution. Gutenberg gives some flexibility but not much.

    • @paulcodes
      @paulcodes Před 2 lety +1

      et tu@@jherbison blasphemy! LOL You are right, and the more I think about it...I think the cost of coding up something custom would be pointless when there are off the shelf solutions. I should create a new channel "How to waste a bunch of time as a developer"

    • @jherbison
      @jherbison  Před 2 lety +1

      I could contribute to that channel for sure! I have spent my fare share of wasting coding time.

  • @user-ly6ws7cz7n
    @user-ly6ws7cz7n Před 2 lety +2

    Thank's for video. I want to learn do my own unique templates and plugins wordpress. Could you do lessons about development plugins with connection front-end data on template layer and front-end admin data panel layer like an example plugin development

    • @jherbison
      @jherbison  Před 2 lety +1

      Thank you for commenting.. I have made several videos that I think meet that criteria. Unless I am missing something. More details could help too.

  • @pabloeduardoibanez
    @pabloeduardoibanez Před 2 lety +1

    Come on Joshua you are giving away all the goods! Indeed this is very helpful just because you can now work on a plugin to integrate all kinds of functionalities to any site without upsetting the theme, the magic is inside the plugin. It allows you also to have better file organization and structure. It is always great to see your work! I wonder how come you don't use vs code?

    • @pabloeduardoibanez
      @pabloeduardoibanez Před 2 lety +1

      BTY I like this JH 2022 version that its posting videos on more regular basis. When I started coding again (I stopped like for 10 years) I will always watch your videos and now here are you again posting again! Great! Congrats! Carry on!

    • @jherbison
      @jherbison  Před 2 lety

      Awesome.. Thank you.

    • @jherbison
      @jherbison  Před 2 lety

      Thank you.. Not a huge fan of anything Microsoft... I do use VS code when I am on my Windows machine, but that is only to update windows software that I have written or if a client wants a windows desktop application (which these days is very rare... Thank GOD!). Sublime Text 3 is very light weight and runs great on my MacBook Pro and My Mac Mini.. All my new videos are done using my Mac Mini. Thank you for watching and commenting..

  • @klaylton
    @klaylton Před 2 lety

    Thank you!

  • @monsieurrado
    @monsieurrado Před 2 lety

    Thank you ! Merci :)

  • @aogunnaike
    @aogunnaike Před 2 lety +2

    This is very helpful thanks alot, God bless you more. Is it possible to share your dev setup as I'm getting a MacBook soon and would love to use your setup especially the way u same and files are updated in the browser, cheers 🥂

    • @jherbison
      @jherbison  Před 2 lety +1

      Thank you. I was thinking about making a video about my setup! I will see if I can get it done tomorrow.

    • @aogunnaike
      @aogunnaike Před 2 lety +1

      Thanks alot, I would really appreciate it

    • @jherbison
      @jherbison  Před 2 lety

      No problem

  • @PolSenserrich
    @PolSenserrich Před 2 lety

    I don't understand why, but as simple as it seems, turned into a nightmare till I found that my return $template variable had to be unique. Different thant $template.
    Then things started working.
    I messed many hours with it, so I hope my comment can help someone, or please, can you give me a comment why it was not working for me?
    Thanks for your content. Your way of explaining things, is really great.

  • @jeffersoncarvalho2566
    @jeffersoncarvalho2566 Před 2 měsíci

    How to make this in a block theme. The templates are in html on the theme, in the templates folder. How to add a template via plugin?

  • @manishbarik2267
    @manishbarik2267 Před rokem

    Thanks. It works with both pages and posts. But the template is not showing for custom post types.

    • @BrockAtkinson
      @BrockAtkinson Před rokem

      You need to replace the text to match the post type slug, e.g. add_filter( "theme_page_templates" ) becomes "theme_event_templates" if your custom post type is an "event".