Custom post type category, taxonomy and URL rewrite problem

Welcome to WPSE. That can be solved pretty straight forward. Register a custom post type products Register two taxonomies (brands and functionalities) for your custom post type Feed WordPress the correct template, following the template hierarchy and WordPress standard Flush your rewrite rules (can’t be skipped, but is easy) Step 1 Register your custom post … Read more

Add filter to wp_list_categories and query what type of taxonomy-terms it use?

WordPress do: apply_filters( ‘wp_list_categories’, $output, $args ); You can do: function add_slug_css_list_categories($list,$args) { } Then you can use $args to determine what kind of list you have. Not sure if you must do that but when you add the filter there is also a variable for accepted arguments: add_filter(‘wp_list_categories’, ‘add_slug_css_list_categories’,10,2);

Automatically assign a custom post to a custom taxonomy based on custom field value

I’m sure this not best answer, however you may try like this add_action(‘save_post’, ‘add_my_taxonomy’); function add_my_taxonomy($post_ID) { $area = array( ‘ny’ => ‘New York’, ‘la’ => ‘Los Angeles’ ); $zip = array( ‘ny’ => ‘10001, 10002, 10003, 10004, 10005, 10006, 10007, 10008, 10009, 10010, 10011, 10012, 10013, 10014, 10015, 10016, 10017, 10018, 10019, 10020, 10021, … Read more

How to display and use all existing tags at my write-post-at-frontend-panel?

try something like this: <?php $taxonomies = array( ‘wissen_tags’ ); $args = array( ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘hide_empty’ => false ); $terms = get_terms($taxonomies,$args); if (count($terms) > 0): i = 0; foreach ($terms as $term): ?> <div class=”wissen_tag_list”> <input type=”radio” value=”<?php echo $term->term_id; ?>” name=”wissen_tags” class=”wissen_tag_list_ckb” <?php if ( $i == 0 ) … Read more

Maintaining WP_Query Relation Among CPT, Custom Taxonomy, Permalinks- CPT UI

Collaborative efforts- For http://novice.dev/books just create custom post type and check rewrite options so that it adds end points. For http://novice.dev/books/book_categories/my_story_books, create custom taxonomy related with the post type and check the options for rewrite options. http://novice.dev/books/thirty-days-and-night will be automatically when above two are done.

How to show a tag archive of one post type only

I’ve worked out a solution to this. I hope this can help someone else. First add the following two functions to your functions.php (or plugin) file: function get_terms_by_post_type( $taxonomies, $post_types ) { global $wpdb; $query = $wpdb->prepare( “SELECT t.*, COUNT(*) from $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN … Read more

Add .html extension to custom post type taxonomies

I’ve tested your first attempt with using a rewrite rule it works add_action(‘init’, ‘add_html_ext_to_custom_post_type_taxonomies’); function add_html_ext_to_custom_post_type_taxonomies() { add_rewrite_rule(‘^product_cat/(.+)\.html’, ‘index.php?product_cat=$matches[1]’, ‘top’); } but you have _ not – had you noticed this as you give your example as www.mydomain.com/product-category/product-category-name.html If its not a mistake it might be you have another rule conflicting with it? and also … Read more

Query posts by custom post type and custom taxonomy

Pretty sure you can’t match multiple taxonomy terms in a query–Wordpress will only honor the first one and ignore the rest. Apparently, this is scheduled to be fixed in 3.1. In the meantime, there is a plugin that’ll fix you right up: http://scribu.net/wordpress/query-multiple-taxonomies EDIT: If you want a non-plugin solution, let me know. I’ve got … Read more

How to rewrite custom post type URL for multiple depths instead of one specific depth

After testing countless different structures i came up with this. It’s manual work specifying each category but gives me more control. If someone comes up with a better solution, please let me know. function mmp_rewrite_rules($rules) { //Product structure $newRules[‘product/(.+)/(.+)/(.+)/(.+)/?$’] = ‘index.php?products=$matches[4]’; //The above structure only works of the postname is the 5th uri segment //It’s … Read more