I need to put a block on a page that displays 'highlighted posts' manually.

First of all, I do not know if there is a better way to do this, creating a new block, or using an existing plugin ... (Maybe I should clone one of these blocks and add the functionality for my case but I'm not sure)

The idea that I have is to be able to use an existing block, for example: 'List of posts' exiting in the 'Gutenberg' editor, or the 'Grid of posts' in the 'Ultimate Addons for Gutenberg' plugin, which I have installed in my WP. and then, adding a new field to it in order to filter the posts.

For this I have added a new field to the posts called 'highlight_in'. which could take values like ('home.top', 'home.moreviews', 'shop.moreviews'...)

My question is that I do not know how to add a new filter for 'highlight_in' field in a block of post I commented before.

NOTE: I should also make a 'SELECT posts WHERE highlight_in LIKE %filter_value%' query to be able to highlight the post in more than one page / block.

I do not know if there are here too many things for a question. So If necessary, I modify or divide the content of this question. Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.