WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Shortcodes in Category Description (2 posts)

  1. pstranney
    Member
    Posted 1 year ago #

    Hi there, I want to know how we can use shortcodes within the category descriptions. I want to display a slider beneath the category description

    Is it possible?

    Thanks in advance,

    PJ

    http://wordpress.org/extend/plugins/woocommerce/

  2. bheadrick
    Member
    Posted 1 year ago #

    so, you want to display a different slider for each category?

    Either way, you can do this using hooks

    add_action( 'woocommerce_product_archive_description', 'post_cat_slider_action', 30 );
    
    function post_cat_slider_action(){
    if(is_term( 'cat-slug-1', 'prod_cat' )) do_shortcode('[someshortcode]');
    
    if(is_term( 'cat-slug-2', 'prod_cat' )) do_shortcode('[someothershortcode]');
    
    }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic