Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Adding code customizations to Boutique Storefront theme

$
0
0

Replies: 0

Hi! My site is about to go public and I’m having a sudden issue. Because I’m using BOUTIQUE, a child theme of woocommerce’s storefront, they say not to add code to the theme’s template, because it won’t stay there with updates. It leads me to download a plugin called Theme Customizations to input my code snippets. I’ve been doing this and it has given me trouble in the past and has now created a critical error in my site. I’ve de-activated the plugin. I’m trying to input the following code to display my 4 custom taxonomies on the frontend of my products. This was working perfectly until it suddenly broke my site. How else can I upload this, and could there be something wrong with the code?

Thanks so much for your help in this time sensitive manner!

add_action( ‘woocommerce_product_meta_end’, ‘action_product_meta_end’ );
function action_product_meta_end() {

global $product;

$term_ids = wp_get_post_terms( $product->get_id(), ‘author’, array(‘fields’ => ‘ids’) );

echo get_the_term_list( $product->get_id(), ‘author’, ‘<span class=”posted_in”>’ . _n( ‘Author:’, ‘Authors:’, count( $term_ids ), ‘woocommerce’ ) . ‘ ‘, ‘, ‘, ‘</span>’ );

global $product;

$term_ids = wp_get_post_terms( $product->get_id(), ‘narrator’, array(‘fields’ => ‘ids’) );

echo get_the_term_list( $product->get_id(), ‘narrator’, ‘<span class=”posted_in”>’ . _n( ‘Narrator:’, ‘Narrators:’, count( $term_ids ), ‘woocommerce’ ) . ‘ ‘, ‘, ‘, ‘</span>’ );

global $product;

$term_ids = wp_get_post_terms( $product->get_id(), ‘series’, array(‘fields’ => ‘ids’) );

echo get_the_term_list( $product->get_id(), ‘series’, ‘<span class=”posted_in”>’ . _n( ‘Series:’, ‘Series:’, count( $term_ids ), ‘woocommerce’ ) . ‘ ‘, ‘, ‘, ‘</span>’ );

global $product;

$term_ids = wp_get_post_terms( $product->get_id(), ‘length’, array(‘fields’ => ‘ids’) );

echo get_the_term_list( $product->get_id(), ‘length’, ‘<span class=”posted_in”>’ . _n( ‘Length:’, ‘Length:’, count( $term_ids ), ‘woocommerce’ ) . ‘ ‘, ‘, ‘, ‘</span>’ );
}


Viewing all articles
Browse latest Browse all 59525

Trending Articles