Show array of meta_value in Edit Post Coloum

The error was here: (Thank you @Rarst) if ($column_name == ‘custom_checkbox_group_sesso’) { $sesso_occupanti = get_post_meta($post_ID, “custom_checkbox_group_sesso”, true); //check that we have a custom field if ($sesso_occupanti != “”) { // Separate our comma separated list into an array $sesso_occupanti = explode(“,”, $sesso_occupanti); //loop through our new array foreach ($sesso_occupanti as $sesso) { echo $sesso ; … Read more

How to show or hide a post based on meta_value selection?

Use the pre_get_posts action to alter the main query with meta_query arguments to only select posts with active current_status. This example would work for your main posts page. See Conditional Tags for how to determine when other types of queries are run. function wpa_current_status( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $meta_query … Read more

Sort column on meta key and meta value

Have you tried changing your orderby value to meta_value, rather than meta_value_num in your status_column_orderby function? This has always worked for me in the past. I’m assuming we are dealing with words, not numbers, since you said “alphabetically” in your question. meta_value is for letters/characters, with meta_value_num reserved for… you guessed it… numbers.

Show posts of an advanced search form

If I am reading your question right, you need AND not OR for the meta query relation ‘relation’ => ‘AND’, I don’t see where you’ve set the $product_* values either. You should be using $_GET[‘product_color’] (etc), but you need to sanitize that user supplied data. I would use a “whitelist” technique if it were me: … Read more

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