Skip Navigation

[Resolved] jQuery with toolset shortcodes

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 10 months, 3 weeks ago.

Assisted by: Waqar.

Author
Posts
#2676894

Tell us what you are trying to do?
i am trying to add
<script>
jQuery(document).ready(function($){
$("h1").first().before("<p>Insight > [wpv-post-taxonomy type='category']</p>");
$("h1").first().after("<h4>BY [wpv-post-author] | [wpv-post-date]</h4>");
});
</script>

when i add it to the body it does not work at all.

when i add it to the js section the short codes don't work

What is the link to your site?
hidden link

#2676990

Hi,

Thank you for contacting us and I'd be happy to assist.

I've checked the page's source code and it turns out the shortcodes are expanding correctly to include the dynamic data in the script.

There in an escaping issue due to the current use of the single and double quotes. I'll recommend to switch the main double-quotes used in the script with the single-quotes, like this:


<script>
jQuery(document).ready(function($){
$('h1').first().before('<p>Insight > [wpv-post-taxonomy type='category']</p>');
$('h1').first().after('<h4>BY [wpv-post-author] | [wpv-post-date]</h4>');
});
</script>

This should do the trick and let me know how it goes.

regards,
Waqar

#2677042

you freaking rock thank you!