why my “recepie” category is not taken into account in my request

This explicit code is missing from your example and you should verify that you have at least these statements (plus any additional post tag functions, or analogous calls to “the_content()”) included exactly as this in your original code: while ( $the_query->have_posts() ) : $the_query->the_post(); the_content(); endwhile; This should roughly be at the location noted by … Read more

I need to update the post query? [closed]

You should use tax_query. $args = [ ‘posts_per_page’ => 10, ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’ ‘tax_query’ => array( array( ‘taxonomy’ => ‘state’, ‘field’ => ‘slug’, ‘terms’ => ‘minnesota’, // lowercase m ), ];

wpdb prepare without placeholder

Short answer: You should use the way described in the documentation, sanitize anything that goes in an SQL query, and always use prepared statements. Slightly longer answer: The main use of $wpdb->prepare() is to prevent against SQL injection attacks. Here, we don’t know where ‘foo’, 1337 and ‘%bar’ come from. And that’s somewhat the deciding … Read more

Remove text from confirmation message

Personally, I would keep that link (despite the page has other links/ways for accessing the post). But if you must, you can remove that “View post” link, or change the entire message, using the post_updated_messages hook. E.g. add_filter( ‘post_updated_messages’, ‘my_post_updated_messages’ ); function my_post_updated_messages( $messages ) { // Note the array index, which is 6 for … Read more

wp_date doesn’t work

I was able to make my local WP installation display the date in French: switch_to_locale( ‘fr_CA’ ); echo wp_date( ‘F d’ ); Output: octobre 11 (Note that I didn’t have to localize my date format string (ie, no __() inside the wp_date() call.) However, when I tried Dutch: switch_to_locale( ‘nl_NL’ ); echo wp_date( ‘F d’ … Read more