Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #567374

    Hi guys,

    I’m wondering if there is a shortcode that i can use to display the product_meta in a customized single product page. Or if there is a simple way to create a shortcode to display the product_meta (such as the plugin additions (product Info) in the avia layout builder)

    I just want to be able to display the product_meta on a custom page

    Thanks!

    #567520

    I had help from the plugin developer, Mike Jolley.

    For those who are interested…
    Here is the code i use to create the shortcode for the SKU

    function cat_shortcode(){
        global $post;
        $cat = get_the_term_list( $post->ID, 'product_cat', true );
        return $cat;
    }
    add_shortcode( 'cat', 'cat_shortcode' );

    And this code is for the Category

    function cat_shortcode(){
        global $post;
        $cat = get_the_term_list( $post->ID, 'product_cat' );
        return $cat;
    }
    add_shortcode( 'cat', 'cat_shortcode' );
    • This reply was modified 8 years, 11 months ago by Benoit.
    #567900

    Hi Benoit!

    Thank you for sharing the tip here :)

    Cheers!
    Vinay

    #567934

    It is a pleasure :)

    • This reply was modified 8 years, 11 months ago by Benoit.
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘shortcode to add product_meta in a custom page’ is closed to new replies.