JavaScript for WordPress Forums Gutenberg Development Dynamic block get posts by category with a way to change category

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #125097
    Claybeast
    Participant

    Hello I am interestec in making a dynamic block that gets the first 5 posts of a certain category or taxonomy. If I have several taxonomies or categories I currently can make a block for each of them but I would like a way (perhaps in inspector controls) to let editors pick which one they want using a single block.

    Is there a way to do this?
    Is there a way to pass conditionals into the dynamic block without using metadata?

    #125098
    Claybeast
    Participant

    uhhh…yeh I should have just looked at the original block code. For future reference https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/latest-posts

    #125163
    Zac Gordon
    Keymaster

    Glad you figured it out!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.