I have a plugin which uses this shortcode: [daisy]
And the html output of this shortcode is : <a class="clickable">Click Here</a>
Plugin is working perfect if I use the shortcode to trigger the plugin.
It works with this also: <?php echo do_shortcode('[daisy]'); ?>
Normally it should work also with the <a class="clickable">Click Here</a>
but it’s not working, the link appears but if I click on it nothing happens.
I want to use the html output because my website is using a lot of javascript for displaying html content I cannot use php shortcodes inside javascript/jquery functions.
So, do you have any suggestions for this issue?
Because I think the shortcode should work also with the html output which triggers that plugin (in my case is a contact form popup)
Thanks!
Later edit: This is the javascript which triggers the plugin:
<script type="text/javascript">
$(document).ready(function(){
// Init Plugin
$(".clickable").contactpopup({
'style' : '<?php echo $wp_cpup_theme; ?>',
'bgcolor' : '<?php echo $wp_cpup_color; ?>',
'formelement' : '#Form_PopContactUs',
'effect' : '<?php echo $wp_cpup_effect; ?>',
'header' : '<?php echo $wp_cpup_popup_title; ?>'
});
});
If you open the plugin file and find where the function add_shortcode(‘daisy’,’someotherfunction’); is, then you could simply call that function that the shortcode is pointing too.
This code could be placed as follows in a plugin or the functions.php file of your theme: