• Resolved ratoli

    (@ramon-kaes)


    I would like a shortcode to insert the brand-description into a custom-tab on the single-product-page.
    It is a great effort to create this?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Mr. W

    (@gabriel-winnberg)

    Please have a look at my previous post, I just did that.

    Gabriel – I would love this shortcode! I’m afraid I can’t find your previous post where you have done this, please would you mind posting the short code again, or a link to the original post. Thanks so much!

    Plugin Contributor titodevera

    (@titodevera)

    Hi!

    1) Add this code to your functions.php for create the shortcode:

    
    function custom_pwb_brand_info() {
    
    	if( is_product() ){
    		$brands = wp_get_post_terms( get_the_ID(), 'pwb-brand' );
    		foreach( $brands as $brand ) {
    			echo '<p>'.$brand->description.'</p>';
    		}
    	}
    
    }
    add_shortcode( 'custom_pwb_brand_info', 'custom_pwb_brand_info' );
    

    2) Install a plugin for adding custom tabs. I suggest you YIKES Custom Product Tabs

    3) Add the shortcode [custom_pwb_brand_info] to your custom tab

    ??

    • This reply was modified 8 years, 1 month ago by titodevera.
    • This reply was modified 8 years, 1 month ago by titodevera.

    many many thanks for your reply titodevera! Much appreciated.

    Thread Starter ratoli

    (@ramon-kaes)

    thanks, very nice!

    Plugin Contributor titodevera

    (@titodevera)

    You’re welcome! Don’t forget to leave a review if you like the plugin ??

    The shortcode doesn’t work after the new update!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘shortcode for custom-tab’ is closed to new replies.