Organising Taxonomy categories

By what criterion do you need to order your taxonomy terms? See this argument-array key: ‘orderby’ => $orderby, Per the documentation for wp_list_categories(), the orderby parameter can take the following values: ‘ID’ – Default ‘name’ ‘slug’ ‘count’ ‘term_group’ Note, you may also want to add the order parameter: ‘orderby’ => ‘ASC’, This parameter takes: ‘ASC’ … Read more

Custom Post Type and Taxonomy combination

// Add the new post_type and taxonomy add_action(‘init’, function(){ // Add a post_type named ‘testype’ register_post_type($postype=”testype”, $arguments = array( ‘name’ => $postype, ‘label’ => ‘Test’, ‘public’ => true, ‘exclude_from_search’ => true, ‘capability_type’ => ‘post’, ‘supports’ => array( ‘title’, ‘excerpt’, ‘editor’, ‘custom-fields’, ‘comments’, ), ‘show_in_nav_menus’ => false, ‘hierarchical’ => false, ‘publicly_queryable’ => true, ‘rewrite’ => array( … Read more

Getting the parent from the wp_term_taxonomy

My experience with this was that it is an issue area of the taxonomy system in core. In several cases the core code does fetch info based on a tt_id or an array of them, but in each of these cases it is painfully done with a custom SQL query inside that particular function rather … Read more

Remove custom posts that match taxonomy value

something along these lines should do it: $args = array( ‘post_type’ => ‘listings’, ‘posts_per_page’=> -1, ‘post_status’ => ‘any’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘status’, ‘field’ => YOUR FIELD NAME HERE??? ‘terms’ => ‘standard’ ) ) ); $query = new WP_Query( $args ); foreach( $query->posts as $id ){ wp_delete_post( $id->ID, TRUE ); }

Custom Author Fields + Existing Taxonomy – Integrating the Two Dynamically?

Figured it out, for anyone who needs help with this I’m sure you can use with categories/tags as well (can also use with radio inputs and checked=”checked”: <tr> <th><label for=”sorority”><?php _e(‘Sorority is…’) ?></label></th> <td><?php $sorority = get_the_author_meta( ‘sorority’, $user->ID ); ?> <select name=”sorority” id=”sorority”> <?php $terms = get_terms(‘sorority’); foreach ( $terms as $term ) { … Read more

Permalink Rewrite for Custom Taxonomy

There are a few parts to making this work. First, we register the taxonomy: function wpa69163_register_txonomy() { register_taxonomy(‘board’, ‘post’, array( ‘labels’ => array( ‘name’ => _x( ‘Boards’, ‘taxonomy general name’ ), ), ‘rewrite’ => array( ‘slug’ => ‘board’, ‘with_front’ => false ) )); } add_action( ‘init’, ‘wpa69163_register_txonomy’, 0 ); Next, we have to add a … Read more

Filter taxonomy terms using multiple id in the edit-tags.php

It’s easy to implement. All you need is your own hook for get_terms_args filter: add_filter( ‘get_terms_args’, ‘wpse8170_get_terms_args’, 10, 2 ); function wpse8170_get_terms_args( $args, $taxonomies ) { if ( !in_array( ‘post_tag’, $taxonomies ) ) { return $args; } $matches = array(); if ( empty( $args[‘search’] ) || !preg_match( ‘/^\#(.*)$/’, $args[‘search’], $matches ) ) { return $args; … Read more

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