Hi @primasilva, your feedback helped me to fix a tiny issue in the snippet!
Here’s the updated code that should prevent the button to be displayed in the menu :
add_action('wp_footer' , 'add_secondary_button_to_a_slide');
function add_secondary_button_to_a_slide() {
?>
<script type="text/javascript">
jQuery(document).ready(function () {
! function ($) {
//prevents js conflicts
"use strict";
var target_original_button_link = '<?php echo get_permalink(2) ?>';
var new_btn_content = ' <a class="btn btn-large btn-warning" href="<?php echo get_permalink(9) ?>">Call to action #2</a>';
//checks if the target slide url exists first
if ( $('a[href="'+ target_original_button_link +'"]' , '#customizr-slider' ).length === 0 )
return;
//adds the new button html content after the original button
$('a[href="'+ target_original_button_link +'"]' , '#customizr-slider').after(new_btn_content);
}(window.jQuery)
});
</script>
<?php
}
Thanks
@rdellconsulting : thanks for reporting as always!