List custom field values ​​in alphabetical order without repetition

You could do a custom SQL query: global $wpdb; $query = “SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = ‘director’ ORDER BY meta_value;”; $directors = $wpdb->get_results( $query ); foreach( $directors as $director ) : echo $director->meta_value; endforeach; one thing to note here though is that since you’re not querying the associated posts, you could get … Read more

How to get a value from comment meta

Looking at the Codex entry for get_comment_meta(), it appears that when the $single argument is set to TRUE (as you have done), the function returns a string. Try throwing an echo() into the works: <?php echo get_comment_meta( $comment->comment_ID, ‘country’, true ); ?>

Does meta_value (array) work with ‘orderby’?

Researching more, I got it to work with the following code $post = array( ‘posts_per_page’ => 10, ‘post_type’ => ‘post’, ‘tax_query’ => array( ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => ‘category-1’ ), ‘meta_query’ => array( array( ‘key’ => ‘custom-key’, ‘value’ => array(1,100), ‘compare’ => ‘BETWEEN’, ‘type’ => ‘NUMERIC’ ) ), ‘meta_key’ => ‘custom-key’, ‘orderby’ … Read more

Add estimated value for a post according to the number of words

Here’s an idea for a starting point, by looking how the word counting is done in the /wp-admin/js/post.js file: /** * Testing word price calculations */ add_action( ‘after_wp_tiny_mce’, function() { ?><script> ( function( $ ) { $( function() { // Init var $content = $( ‘#content’ ), $count = $( ‘#wp-word-count’ ).find( ‘.word-count’ ), total_price … Read more

Find a way to retrive data updated through metabox plugin to web page

So finally I found a way to do that. Here is the code. page-contact.php <!– Contact Info –> <div class=”contact-info col-md-4 col-sm-4 margin-top-20 padding-left-20″> <label class=”contact-label pull-left width-wide”>Contact Info</label> <p><strong>IT’S SHOWTIME TOWING</strong><br /><br /> <!–Phone: <a href=”https://wordpress.stackexchange.com/questions/355497/tel:0450749863″>0450749863</a><br /><br /> –> Phone: <a href=”https://wordpress.stackexchange.com/questions/355497/tel:0450749863″><?php echo get_post_meta( $post->ID, ‘telNo’, true );?></a><br /><br /> <!–Email: <a href=”mailto:[email protected]”>[email protected]</a><br /><br … Read more