Custom Query for Taxonomy
If you want a list of the terms, use get_terms(): <?php $terms = get_terms(‘pa_main-genre’, array(‘orderby’ => name,)); ?>
If you want a list of the terms, use get_terms(): <?php $terms = get_terms(‘pa_main-genre’, array(‘orderby’ => name,)); ?>
Try this: <?php $term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) ); $parent = get_term($term->parent, get_query_var(‘taxonomy’) ); echo $parent->name; ?> You have to get the current term slug and then use get_term by the slug and then echo the name.
I think you were trying to use mysite.com/tag/tag_slug ie damien.co/tag/wordpress You can try to use ?s= (search) and ?t= (tag) as URL parameters
Yes, setting the $object_type, the second argument in the register_taxonomy function, set the value to an array including your custom post type slug and post. register_taxonomy($taxonomy, array(‘post’,’your-custom-post-type-slug’), $args); Review: http://codex.wordpress.org/Function_Reference/register_taxonomy Also check out my plugin http://wordpress.org/extend/plugins/reed-write/. It makes custom post types and custom taxonomies a breeze.
have a look on here for e-commerce and then go install WooCommerce or GetShopped Thi should be easiest and you wont need to do much development …. as you want to ‘contact to order’ This might also help: http://wordpress.damien.co/2012/07/choose-the-right-wordpress-e-commerce-solution-for-you/
Have you noticed in the list all of valid Parameters for wp_list_categories() function that taxonomy doesn’t accept input as array, thats why you are not supposed to pass an array to it. If you still want to be able to show terms of two different taxonomies, use get_terms() WordPress function instead. The only bad is … Read more
If you are OK choosing which categories users can post to check out restrict categories. You can assign each user one or multiple categories that they can post to.
This is how I did it : function if_restrict_categories($categories) { global $current_user; $a = get_cat_if_user($current_user->ID); $onPostPage = (strpos($_SERVER[‘PHP_SELF’], ‘edit-tags.php’)); if (is_admin() && $onPostPage && !current_user_can(‘level_10’)) { $size = count($categories); for ($i = 0; $i < $size; $i++) { if($categories[$i]->parent != $a && $categories[$i]->term_id != $a){ unset($categories[$i]); } } } return $categories; } add_filter(‘get_terms’, ‘if_restrict_categories’); And … Read more
I use this function to display comma separated terms from a custom taxonomy: // Get Comma Seperated List of Custom Taxonomy // function the_custom_taxonomies($taxonomy) { global $post; $terms = get_the_terms($post->ID, $taxonomy); $counter = 0; if (!empty($terms)) { foreach ($terms as $term) { echo $term->name; if (++$counter < count($terms)) echo “, “; } } }
It sounds like making a custom post type called “Products” would be the best way for you to manage the products. Unless you want a special name for the taxonomy, you could just make your custom post type use the default “Category” taxonomy for organizing your products. The simplest way to add data like article … Read more