Altering term_id and name via $wpdb class

You can do it easily. Your query should be: $querystr = “SELECT `term_id` AS `id`, `name` AS `value`, `slug`, `term_group` FROM {$wpdb->terms} WHERE lower($wpdb->terms.name) like ‘%$s%'”; See, here i’ve mentioned the name of the fields needed. For any other fields, you need to explicitly mention the field names.

Using post type archive page for taxonomy archive

Have you checked the WordPress Template Hierarchy Diagram To get an idea how wordpress choose the tempalte. I’m not sure but according to the WordPress Template Hierarchy, WordPress will choose default archive.php for custom taxonomy if no special template is specified. That means you cannot not have archive-product.php to use with Custom Taxonomy archive. In … Read more

register_taxonomy – show in admin menu, but not on post type (edit) screen

As per le comment. function remove_artist_meta() { remove_meta_box( ‘{taxonomy name}’, ‘post’, ‘side’ ); } add_action( ‘admin_menu’ , ‘remove_artist_meta’ ); The Admin menu has been always difficult to deal with, some help here would be nice: http://core.trac.wordpress.org/ticket/12718 But I think that this could be added a a parameter to register_taxonomy. http://core.trac.wordpress.org/ticket/21543

List child terms and posts in the current term

ok, i don’t know how this looks but i’ve got exactly what i wanted. <?php $term = get_queried_object(); $tax = ‘ntp_package_type’; $parents = $term->parent; $term_id = $term->term_id; if($parents == 0 && !is_single()){ wp_list_categories( array ( ‘taxonomy’ => ‘ntp_package_type’, ‘pad_counts’=> 0, ‘title_li’ => ”, ‘child_of’ => $term_id, ) ); } elseif ($parents > 0 && is_tax($tax, … Read more

Function code problem

If the code above is how it is in your actual theme file, there are obvious errors (maybe it didn’t post right here). Here is the fixed code: <?php add_filter(‘post_type_link’, ‘my_permalink_structure’, 10, 4); function my_permalink_structure($post_link, $post, $leavename, $sample) { if ( false !== strpos( $post_link, ‘%states%’ ) ) { $term = get_the_terms( $post->ID, ‘states’ ); … Read more

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