WordPress custom post type block templates

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.ย. 2024
  • When adding custom post types to WordPress when using the block editor, it often makes sense to provide the user with set template of blocks, pre-populated on the page which they can fill in.
    In this video I will show you how to achieve this in WordPress, whilst also allowing particular parts of a layout to remain flexilble.
    🔗 developer.word...

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

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

    Great! What I like best about this method is that it works from within a plugin.

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

    Very useful tutorial, thx

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

    Thanks so much I have been trying to figure out the new way of creating custom post types with blocks and this is a huge help.

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

    Thanks for heading us into this, had no idea! I think I will opt for a combination of Gutenberg locked blocks and regular single-{slug}.php with custom fields for certain things.

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

    This is the best news i have in the worpress word.
    Now if we can link the Custom Post Fields... IS GONNA BE GLORY, lol

  • @bradfranklin-j66co
    @bradfranklin-j66co 2 ปีที่แล้ว

    Great tips!! Thank you so much for sharing! I’m going to try this as well as share your video within a fb group. You’ve gained a New subscriber!

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

    Wow! This is amazing discovery. I have to use this.

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

    Brilliant new way to handle CPT’s!

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

    I had seen examples of block templates as far back as a couple of years ago but never really tried to implement, instead using a custom fields plugin and the new dynamic content feature found in a few block sets. I should revisit templates as there’s then no need for a custom fields plugin.

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

    Congrats on the 1K subs!! I love your content! :)

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

      Thanks Chris. Pleased you are enjoying it.

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

    Nice one, thanks for sharing!

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

    Amazing tutorial

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

    Ah, so cool! Thanks for sharing!

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

      Thanks for watching and really pleased you found it useful.

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

    Nice work on doing that. Template as jason looks a total mess. Would be nice if it could be maybe more like the jsx format in custom blocks which feels more like html so you can see it more visually.
    As imagine debug a pain but like to try this out with client.

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

    This is insanely useful!!! Thank you

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

    very cool :)

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

    Is it possible to edit the template and then have it automatically update all the corresponding posts or would you have to redo all the posts?

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

      I believe you would have to redo the other posts, but I am not certain [M]

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

      @@HighriseDigital Okay, thank you for the quick response!

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

    This is a great feature and explanation. I'm unclear, though as to how this can map to ACF fields for custom post types. So, when an author creates a new record for a book, for example, and there is a placeholder for ISBN number. If they fill that out, can that be directly mapped to that ACF field? Not sure i"m making sense.

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

      To be honest no I am not sure. You can include custom blocks, built with ACF for example in your block template.

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

      @@HighriseDigital how do you target an ACF custom block? Every time I try I can't seem to do so I get block errors.
      I know array('core/{block-name}') is how to target core blocks but I'm struggling to find documentation for the other

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

      @@andrewfair6983 depends exactly what you mean by "target" and where. But all acf block are prefix with acf/. Therefore if your block name when declaring your block with acf_register_block_rtype() is cta, then the block is called acf/cta [M]

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

    Very cool thanks Mark! Do you think its possible to give a custom (ACF) block that attribute that allows you to lock/not lock the inner blocks? I wonder if innerBlocks are unlocked by default even if the whole layout itself is locked!?

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

      If you have an ACF block that uses InnerBlocks then it is unlocked automatically.
      Before I found that the group block had this unlocked feature, I create an ACF block called "Paragraph holder" that was just for holding paragraphs with InnerBlocks.
      However the group block with the the templateLock attribute solves the need for this.

  • @be73bsu82-qj2sc
    @be73bsu82-qj2sc ปีที่แล้ว

    As a freelancer, how much do I charge my client for creating a single custom template which includes sidebar, comments and infinite loading? This is extremely urgent to know before my client sets me on low rates.

    • @be73bsu82-qj2sc
      @be73bsu82-qj2sc ปีที่แล้ว

      Apart from that, I've created a custom theme, not using elementor.

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

      Hi Aman, That's an impossible question to answer! Here's one idea, charge an amount that both you and the client are happy with. And I'm intrigued, how can a client set your rates? [KD]