Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • HappyFriends7000
    Participant

    Hello Guys,

    wanted to add following code to short coder Plugin, but its not working:

    ——————–
    function displayProductName($item) {
    $productName = get_the_title($item[‘id’]);
    return $productName;
    }

    add_shortcode(‘product_name’, ‘displayProductName’);
    ——————-

    Code should disdplay title of WOO product with id=”XYZ”

    Used following shortcode: [sc name="woo_get_productname" id="8876"]

    “woo_get_productname” was my given name in short coder.

    Using Guntener Business Theme and Elementor Pro.

    Thxs for your help, Markus

    Hi Markus,

    Sorry for the late reply.

    As I can understand it looks like you are pasting “PHP” code as shortcode content ?

    In that case, please note that we can create shortodes only for HTML/CSS/JS.
    Please do clarify on this.

    Thanks,
    Aakash

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Subscribe for updates

Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam.