Show different sidebar on taxonomy pages when a default is set

Why don’t you simply create a new sidebar… It will be clearer for you and will lighten your sidebar.php. Create a file in your theme folder : sidebar-thenameyouwant.php put your sidebar code there like this ex : <div id=”secondary”> <?php dynamic_sidebar( ‘sidebar-xyz’ ); ?> </div><!– #secondary .widget-area –> in your themes function.php… add : register_sidebar( … Read more

Custom Taxonomy Archive URL rewrite

WordPress doesn’t generate an ‘archive of terms’ automatically. However, you’re current permalink structure is set up so that: www.example.com/my_taxo/my-term points to the ‘my-term’ archive page of the ‘my_taxo’ taxonomy (listing all posts with the ‘my-term’ tag). So what you can do is create a page with slug ‘my_taxo’: www.example.com/my_taxo Assign this page a custom template … Read more

New rewrite rules for custom taxonomy and reuse default

Note that the url-rewriting doesn’t directly determine the template used. A pretty url is interpreted as a query and then that query determines what template is used based on the template hierarchy. So only need one rule: example.com/localdeals/myterm => example.com/?location=myterm WordPress will look for the template taxonomy-location-myterm.php and use that (if it exists) or otherwise … Read more

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.