Display posts if a custom field value is equal to another custom field value

There’s some contradiction between your question and the code you provided, so I’m not exactly sure which of two scenarios you’re dealing with. Scenario 1 – You want to show all Shops with a specific value for shop-id and all Restaurants with the same specific value for restaurant-id. Let’s say that value is 20. You … Read more

Building an Advanced Search (text, tags, category, custom fields) – Getting the wrong SQL query

SOLUTION: I will post my solution and explain what was the problem and I hope that this post can help someone in the future. As we talk in the small comments the problem, was that I was sending a non existing taxonomy by error and this was causing the AND (0=1). To fix the whole … Read more

Change message given when deleting post from custom post type

There’s no hook named post_trashed_messages, but there is the bulk_post_updated_messages hook which you can use to change the bulk action updated messages: add_filter( ‘bulk_post_updated_messages’, function ( $bulk_messages, $bulk_counts ) { $bulk_messages[‘post’][‘trashed’] = _n( ‘%s post successfully deleted.’, ‘%s posts successfully deleted.’, $bulk_counts[‘trashed’] ); return $bulk_messages; }, 10, 2 ); Or to target a specific post … Read more

Show ACF field from custom taxonomy and display on the single template

I would try something like this… // Assume there is only one category. $product_category = get_the_terms($post, ‘product-category’)[0]; $cat_fields = get_fields(“term_$product_category”); $color = $cat_fields[‘category_colour_primary’]; You could also do this… // Assume there is only one category. $product_category = get_the_terms($post, ‘product-category’)[0]; $color = get_field(‘category_colour_primary’, “term_$product_category”);

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)