custom-taxonomy

custom taxonomy image option in admin panel

∥☆過路亽.° 提交于 2019-12-06 04:37:45
I have created a custom taxonomy and want to have a image option for each category. function create_product_taxonomies() { // Add new taxonomy, make it hierarchical (like categories) $labels = array( 'name' => _x('product_categories', 'taxonomy general name'), 'singular_name' => _x('Product', 'taxonomy singular name'), 'search_items' => __('Search Product Category'), 'all_items' => __('All Product Categorie(s)'), 'parent_item' => __('Parent Product Category'), 'parent_item_colon' => __('Parent Product Category:'), 'edit_item' => __('Edit Product Category'), 'update_item' => __('Update Product

Custom product price suffix on based on product categories in Woocommerce

吃可爱长大的小学妹 提交于 2019-12-05 20:04:35
I need to add 'per metre' to the price on most of my online catalogue, I tried the code on this thread in my finctions.php but I cannot get it to omit/include particular categories- it seems to be all or nothing. What am I doing wrong? I have edited the code as such: /*add 'per metre' after selected items*/ add_filter( 'woocommerce_get_price_html', 'conditional_price_suffix', 20, 2 ); function conditional_price_suffix( $price, $product ) { // HERE define your product categories (can be IDs, slugs or names) $product_categories = array('fabric','haberdashery', 'lining',); if( ! has_term(

Have a WordPress page with same title as custom post type “front” slug

不想你离开。 提交于 2019-12-05 00:46:43
I have a custom post type djs and a custom taxonomy city with two terms: boston and nyc . So a DJ can either be tagged as Boston or NYC. DJ profiles (a single djs post) are located at /nyc-wedding-dj/joe-shmoe/ , for example, or for a Boston DJ, /boston-wedding-dj/jane-doe/ . In other words, the rewrite slug for that custom post type is set as %city%-wedding-dj . I have two regular pages called /boston-wedding-djs/ and /nyc-wedding-djs/ (note the plural DJs with an s ) where I use a custom page template to loop through the DJs from the corresponding city and display a list of links to DJ

Using a custom single product template for a specific product category in Woocommerce

限于喜欢 提交于 2019-12-04 18:42:18
I'm trying to use a custom page for only one of the products in the woocommerce shop. I've been trying to apply the attached function but without success (which code is coming from this answer ). I have a created a copy of the single-product.php file in my /woocommerce folder with some added code, but the single product view only shows the "standard" single-product-php and not my single-product-mock.php file. And the product does have the product category "custom". add_filter( 'template_include', 'so_43621049_template_include', 10 ); function so_43621049_template_include( $template ) { if ( is

Add custom fields in custom taxonomy meta box in wordpress-3.5.2

末鹿安然 提交于 2019-12-04 17:39:36
Unable to add custom fields in custom taxonomy meta box in wordpress-3.5.2. I have checked solution in various blogs but Unable to solved this problem. I am using wordpress-3.5.2 What I am trying is :- // A callback function to add a custom field to our "adtag" taxonomy add_action( 'adtag_edit_form_fields', 'adtag_callback_function', 10, 2); // A callback function to save our extra taxonomy field(s) add_action( 'edited_adtag', 'save_taxonomy_custom_fields', 10, 2 ); I have tried solution from below link:- http://www.codehooligans.com/2010/07/07/custom-meta-for-new-taxonomies-in-wordpress-3-0/

How to get the taxonomy values of a custom post type

混江龙づ霸主 提交于 2019-12-03 13:43:01
问题 I am creating a new template that will get all the custom post type (Case Studies) content, including the taxonomies values associated with it. So far I got the following: <section> <h1><?php _e( 'posts', 'casestudies' ); ?></h1> <?php get_template_part('loop'); ?> <?php $args = array('post_type' => 'casestudies', 'posts_per_page' => 3); $query = new WP_Query($args); while($query -> have_posts()) : $query -> the_post(); ?> <h2><?php the_title(); ?></h2> <p>Meta: <?php the_meta(); ?></p> <p

How to get the taxonomy values of a custom post type

柔情痞子 提交于 2019-12-03 03:02:16
I am creating a new template that will get all the custom post type (Case Studies) content, including the taxonomies values associated with it. So far I got the following: <section> <h1><?php _e( 'posts', 'casestudies' ); ?></h1> <?php get_template_part('loop'); ?> <?php $args = array('post_type' => 'casestudies', 'posts_per_page' => 3); $query = new WP_Query($args); while($query -> have_posts()) : $query -> the_post(); ?> <h2><?php the_title(); ?></h2> <p>Meta: <?php the_meta(); ?></p> <p>Excerpt: <?php the_excerpt(); ?></p> <p>what_to_put_here_to_get_taxonomies_values????</p> <?php endwhile;

Display current post custom taxonomy in WordPress

若如初见. 提交于 2019-12-02 19:45:38
I've created custom taxonomies on WordPress and I want to display the current post taxonomies on the post in a list. I'm using the following code to display a custom taxonomy named "Job Discipline": <ul> <?php $args = array('taxonomy' => 'job_discipline'); ?> <?php $tax_menu_items = get_categories( $args ); foreach ( $tax_menu_items as $tax_menu_item ):?> <li> Job Discipline: <a href="<?php echo get_term_link($tax_menu_item,$tax_menu_item->taxonomy); ?>"> <?php echo $tax_menu_item->name; ?> </a> </li> <?php endforeach; ?> </ul> That's just one of many taxonomies I want to list. The problem is

Display category and brand name on single product page

大城市里の小女人 提交于 2019-12-02 13:42:06
问题 In Woocommerce, I am using YITH WooCommerce Brands plugin to handle product brands. I'm currently struggling with a fixed text That I want under my short description in WooCommerce. I want to display dynamically the product name in that text (which works) , but also the product category name [CATEGORY_NAME] and brand name [BRAND_NAME] . But I can't seem to get those to work. Based on this answer thread: Add Text under Single Product Short Description in Woocommerce Here is my code version: //

Disable other product categories for a cart item from specific category in Woocommerce

◇◆丶佛笑我妖孽 提交于 2019-12-02 13:01:15
问题 I'm developing a webshop, with different aspects, the first is a regular shop, and the second is a night beer service. i've searched but can't find what i am looking for; First the night beer service is a specific category that shouldn't be ordered with the regular items (if category 'beerservice' is in the cart, disable all other categories to be added to the cart). This option also needs to work vice-versa (the other wat around), so if a regular item is added to the cart, the category of