Exclude Duplicate Posts in this SELECT Query
Remove DISTINCT And add GROUP BY $wpdb->posts.ID before ‘ORDER BY’
Remove DISTINCT And add GROUP BY $wpdb->posts.ID before ‘ORDER BY’
This would have to be fully coded and tested, but I think the roadmap is: Deregister the Default Meta Box and Make a Custom One @MikeSchinkel answer to this question is very detailed and thoughtful: Adding Page Attributes Metabox and Page Templates to the Posts Edit Page? In that case, it is for duplicating the … Read more
$taxonomy = ‘training_cats’; $orderby = ‘name’; $show_count = 0; // 1 for yes, 0 for no $pad_counts = 0; // 1 for yes, 0 for no $hierarchical = 0; // 1 for yes, 0 for no $title=””; $empty = 0; $args = array( ‘name’ => $taxonomy, ‘orderby’ => $orderby, ‘show_count’ => $show_count, ‘pad_counts’ => $pad_counts, … Read more
I would suggest, that you switch from “URl query argument” style to arrays. This is a “feature” that is more a left over on some functions that is only available for backwards compatibility reasons than anything else. Here’s a reworked version of your current arguments: wp_dropdown_pages( array( ‘title_li’ => ”, ‘depth’ => TRUE, // originally: … Read more
There is no (good) way to solve this problem in its current state with CSS. The best solution is to add an extra class to the last active div, or to use javascript See this question for more details
I’m not a programmer so there’s probably a far more efficient/correct way of doing this. Put this in functions.php or a custom plugin: function get_terms_by_post_type( $taxonomies, $post_types ) { global $wpdb; $query = $wpdb->get_results( “SELECT t.*, COUNT(*) from $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN $wpdb->term_relationships AS r … Read more
Select menu should display categories and the item’s depth
Sounds like you want wp_dropdown_categories() to me: $tax_args = array( ‘taxonomy’ => ‘location’, ‘orderby’ => ‘name’, ‘show_count’ => 1, ‘hierarchical’ => 1, ); wp_dropdown_categories($tax_args);
It’s not working because: You are redirecting home You don’t listen for the $_GET variable so the archive link is just appended to your home url You need to add a function that listens for that $_GET variable. just add this to your functions.php file add_action( ‘template_redirect’, ‘wpse_archive_select’ ); function wpse_archive_select(){ if( isset( $_GET[ ‘archive-dropdown’ … Read more
The reason your $item == $option condition is always failing is because of the way PHP compares floats! Try the following instead: echo “<option value=”$item”” . selected (abs ($item – $options) <= 0.01, true, false) . “>$item</option>” ; See Comparing floats for more info.