Filter and display a specific custom field value [closed]

Now with the new information I would go with this: ?> <form method=”post” action=”where_ever_you_want_to_point_the_user_afterwards.php”> /* The loop: */ if (the_field(‘departures’) == ‘user_departure_location’) { <input type=”radio” name=”destination” value=”<?php echo the_field(‘destination’); ?>”> <a href=”https://wordpress.stackexchange.com/questions/154925/<?php the_permalink(); ?>”> Destination: <?php the_field(‘destination’); ?> Departing from:<?php the_field(‘departures’); ?> Price:<?php the_field(‘price’); ?> </a> } /* The loop end */ ?></form> And then … Read more

The sorting of posts by a meta_query with two keys fails while separated as single queries it works

You can only sort on 1 meta value. A few posts (including this SE answer) suggest adding a filter to change the order. Add a function to your theme’s function.php file that will replace the sort order: function change_sort_order( $orderby ) { return str_replace(‘wp_posts.post_date’, ‘mt2.meta_value, mt1.meta_value’, $orderby); } Then use it where you want. Make … Read more

Array sorting by custom field date

You need to use the type parameter for custom field. Try this once <?php $currentshowid = get_the_ID(); $today = date(‘Y-m-d’); $args = array( ‘meta_key’ => ‘show_id’, ‘meta_value’ => $currentshowid, ‘orderby’ => ‘meta_value_num’, ‘order’ => ASC, ‘meta_query’ =>array( ‘relation’ => ‘AND’, array( ‘key’ => ‘date_end’, ‘value’ => $today, ‘compare’ => ‘>=’, ‘type’ => ‘date’ ), ), … Read more

WordPress taxonomy child image

You need to ask for the child term image field. You have only asked for the current page’s query object image, which may be blank depending on what the query object is. <?php $term_id = get_queried_object()->term_id; $taxonomy_name = get_query_var( ‘taxonomy’ ); $termchildren = get_term_children( $term_id, $taxonomy_name ); // Loop through each child taxonomy term foreach … Read more

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