Extend the Capabilities of GenerateBlocks Query Block to Show Upcoming Events
HTML-код
- Опубликовано: 9 фев 2025
- @GenerateBlocks #acf #wordpress
In this tutorial I am going to show how to build an Upcoming Events query using GenerateBlocks Query Blocks and a PhP filter. The tutotrial involves some coding, but I also share the snippet here.
The filter I will be using works pretty much like a pre_get_posts hook, so to explore further, you should look at the documentation of pre_get_posts.
GenerateBlocks: generateblocks...
GeneratePress: generatepress....
Advanced Custom Fields: advancedcustom...
THE CODE SNIPPET USED IN VIDEO: gist.github.co...
developer.word...
Thanks a lot for this informative tutorial 😀
Glad you find it useful
This is a great solution, thank you. Would it be possible to use the same method to show posts belonging to a relationship field / post query field? Or would the best way to achieve that be on your other video (showing the attached list of people) ? Thanks you!
possibly, I have not tried, but since you have access to meta query with this I do not see why not
Thanks for this useful tutorial :) Question: Instead of placing the code using the child-theme, would it also work when added via "Code Snippets" plugin?
Sure whatever method you prefer.