Archived topic
Reveal card
19 replies · Started by Nikola on May 6, 2017
Viewing posts 16–20 of 20
The WP editor can do that sometimes, especially with javascript.
You could turn the button into a shortcode:
add_shortcode( 'flip_button', 'tu_flip_button' );
function tu_flip_button() {
ob_start();
?>
<button onclick="document.querySelector('#flip-toggle').classList.toggle('flip');"class="button transparent crni">Nazad</button>
<?php
$ret = ob_get_contents();
ob_end_clean();
return $ret;
}
Then you could do this:
[flip_button]
How to create shortcode? Like a script in footer hook or?
Sory for disturbing.
Thanks.
Add Tom's code using Code Snippet: https://docs.generatepress.com/article/adding-php/#code-snippets
Ok, thank you very much guys!
Best regards
Nikola
Glad we could help!
This archived topic is closed to new replies.