pull all posts’ meta key values from current category only

Apologies, but my PHP isn’t wonderful… but I believe for someone who has some at least average php skill, this will make sense. I cut and pasted this line from a query I am doing against a custom taxonomy myself where I only wanted it to display each term only once. $terms = array_map(“unserialize”, array_unique(array_map(“serialize”, … Read more

Ordering by ‘Title’ OR ‘Custom Field’

i assume its exclusive to either sort by title $_GET[‘sort_title’] OR sort by custom field ( but not necessarily) and you that you pass $_GET[‘sort_price’]. if neither are present, “title” is default. with that in mind, check both values if( isset($_GET[‘sort_title’]) ) { $sort_by = $_GET[‘sort_title’]; //orderby can accept multiple values } elseif ( isset($_GET[‘sort_price’]) … Read more

Meta Box Plugin Cloned Fields – Multiple Foreach values

amit helped you out, but while we’re at it you really shouldn’t be echoing everything like that. Should probably try this instead: <?php foreach ( $videoID as $value ) { ?> <div class=”video-pops”> <a class=”thumb video-pop-lb” data-video-pid=”<?php echo $videoID; ?>”></a> <?php } ?> And so on. You may even be better off using the alternate … Read more

Display custom field value as a mailto: link

well you did all the hard stuff, so you can try this: while ( $loop->have_posts() ) : $loop->the_post(); $mail = get_post_meta($post->ID, ‘mail’, true); if ($mail) { echo ‘<a href=”https://wordpress.stackexchange.com/questions/60953/mailto:”.$mail.'”>email me at ‘.$mail.'</a>’; } /* … */

How to sort by custom field value?

From what I understood from your question, you want to sort your result by the most rated custom field ‘rating’ which is assumed to be number. In order to do this you need to write the below wp_query argument and to handle it properly in your request. However the end result for your query should … Read more

How to change order of posts in admin

Adding Columns to Admin To answer your first question, I recommend a plugin called Codepress Admin Columns. This is by far one of the easier and non-coding ways to implement columns. But it will set you back 15EUR to purchase the add-on that allows sorting. If you wish to get your hands dirty with code … Read more