-
AuthorPosts
-
October 5, 2016 at 10:35 am #695391
Hello guys
I have a problem with using a shortcode in the LayerSlider. I have read a lot about other topics regarding this issue but not sure if it is just not possible. I have created a custom shortcode in my child theme functions.php file like this:function ticketcounter() {
$product_id = 23947;
$product = wc_get_product($product_id);
$productcount = $product->get_stock_quantity();
return $productcount;
}
add_shortcode(‘myticketcounter’, ‘ticketcounter’);It displays fine on a page and shows the actual stock quantity. But when i use it on the LayerSlider it shows the stock quantity at the moment i save the slider but it does not update the stock quantity after this point.
Any ideas?
Kind regards,
Michael Storm- This topic was modified 8 years, 2 months ago by mstorm85.
October 7, 2016 at 8:53 am #696350Anyone?
October 10, 2016 at 2:22 pm #697344Hi,
can you provide us screenshots to make it clear to us about which elements you’re talking exactly? I can’t find any stock quantity on the link you’ve provided.
However, I think this would be out of our support scope and a job for a freelance developer.
Best regards,
AndyOctober 10, 2016 at 2:33 pm #697355Hello Andy
I work professionally with webdesign so you could call me a freelancer – i have bought several licens to Enfold. I had to remove the layerslider duo to a deadline so you wont find the layerslider on the link i provided anymore.
I can not activated now as my deadline is tomorrow and i have to finish up the website. But the problem still exist.
A custom shortcode function only provides an output on save. It does not update on every page load. In an other post I saw someone write that it obviously does not run the shortcode function but not why.
I can not provide a link at this moment but if you find a solution to this “issue” it would be great for future projects. Is i wrote it works perfectly on regular pages so the shortcode worked fine. Just not in the layerslider.
Kind regards,
MichaelOctober 11, 2016 at 10:54 am #697724Hi,
we need a link showing the elements and the issue you’re talking about, to be able to inspect everything. Let me know when you can provide us a test link.
Best regards,
AndyOctober 11, 2016 at 11:03 am #697728Hey Andy
I understand. Just close the topic. I can not provide a link on this project anymore duo to the deadline i had. I dropped the LayerSlider and just added a color section instead.
Kind regards,
MichaelOctober 11, 2016 at 11:51 am #697748Hi,
alright! Let us know in a new ticket if you have some more questions related to the theme. We are happy to assist you.
Best regards,
Andy -
AuthorPosts
- The topic ‘Custom shortcode in layerslider’ is closed to new replies.