Add filter by custom field to block of posts

I need to put a block on a page that displays 'highlighted posts' manually.First of all, I do not know if ther

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745325288a4622628.html

相关推荐

  • Add filter by custom field to block of posts

    I need to put a block on a page that displays 'highlighted posts' manually.First of all, I do not know if ther

    10小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信