Integrating an interactive map into a WordPress custom post type

The easiest way would be to use a function which accepts a region taxonomy term as an argument, and outputs a list of posts with that term (i.e. ‘in that region’). So your template looks like: <!–nw–> <div id=”nw” class=”counties-container”> <h2>North West</h2> <p class=”nw-t”><?php my_posts_by_region(‘nw’); ?></p> </div> I’m assuming that ‘nw’ is the term name … Read more

Custom SQL Query on Custom Post Type. Order by Taxonomy?

Just looking at the term_taxonomy table, you are selecting everything correctly, but the last part: WHERE $wpdb->posts.post_type=”publications” AND $wpdb->terms.slug = %s AND $wpdb->term_taxonomy.taxonomy = ‘category’ ORDER BY $wpdb->term_taxonomy.taxonomy = ‘topics’ DESC from the post_type of publications, the terms slug of %s, and has the taxonomy of categories, but you are never selecting the taxonomy topics. … Read more

Taxonomy terms with edit/filter link in wp-admin, in the list of custom posts

It doesn’t have it wrapped inside a function you can use, but the following will work: $taxonomy = ‘my-taxonomy’; $taxonomy_object = get_taxonomy( $taxonomy ); $object_type = get_post_type($post_id); if ( $terms = get_the_terms( $post_id, $taxonomy ) ) { $out = array(); foreach ( $terms as $t ) { $posts_in_term_qv = array(); $posts_in_term_qv[‘post_type’] = $object_type; if ( … Read more

How to sort list of custom posts to get view like a tree of posts under categories and their children’s categories?

ok, this is my working solution: <?php $args=array( ‘post_type’ => ‘biblioteka’, ‘child_of’ => 0, ‘parent’ => ”, ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘hide_empty’ => 1, ‘hierarchical’ => 1, ‘exclude’ => ”, ‘include’ => ”, ‘number’ => ”, ‘taxonomy’ => ‘kategoria-pozycji’, ‘pad_counts’ => false ); $categories=get_categories($args); foreach ( $categories as $category ) { if ( … Read more