amarhuda
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: set tax_query of query loop block with pre_get_post actionthanks @bcworkz it’s finally work, forgot to Mark as resolved yesterday
Forum: Developing with WordPress
In reply to: set tax_query of query loop block with pre_get_post actionit’s my first time using WordPress so i am not pretty sure how to do it, for the second technique should I use remove_filter at the last before return of function posts_where hook?
Forum: Plugins
In reply to: [Gutenberg] set tax_query of query loop block with pre_get_post actioni am also not pretty sure about category and taxonomy was a samething, can you explain it to me if you understand the difference between category and taxonomy?
Forum: Plugins
In reply to: [Gutenberg] set tax_query of query loop block with pre_get_post actionbut from the link you send me is it going to make a new blocks in my wordpress?
Forum: Plugins
In reply to: [Gutenberg] set tax_query of query loop block with pre_get_post actionhi, @welcher thanks for your answer.
Also found this method to but I don’t know how to combine pre_render with query_loop_block_query_vars, i Will try it.
have you also try to adding tax_query instead of cat?
Forum: Developing with WordPress
In reply to: set tax_query of query loop block with pre_get_post actionFound some way to replace the reseted query using posts_join and posts_where hook, but get in new problem with the query will applied to some get_post() method. now the question is how to make the query only applied to get_post() method on the theme component?
Forum: Developing with WordPress
In reply to: set tax_query of query loop block with pre_get_post actionHey @bcworkz thanks for replying.
i have try using Query Monitor plugin and found some oddities,
so, when i try to add taxonomy to queryloop Block the query will be:
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (20) ) AND ((wp_posts.post_type = 'faq' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled' OR wp_posts.post_status = 'private'))) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 10but when i try to change the taxonomy with the code above, the query will become:
SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND ( 0 = 1 ) AND ((wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'acf-disabled'))) GROUP BY wp_posts.ID ORDER BY wp_posts.post_date DESC LIMIT 0, 10it’s seem like the query being reset to the default query of queryloop Block.