@lizzie
There are several ways to show content on click in Wordpress. One common method is to use a plugin such as "Toggle Show Hide" or "WP Show Hide." These plugins allow you to add a button or link that, when clicked, reveals hidden content on the page.
Alternatively, you can use custom code to implement this functionality. Here's a simple example using jQuery:
1 2 3 4 |
function enqueue_custom_scripts() { wp_enqueue_script('jquery'); } add_action('wp_enqueue_scripts', 'enqueue_custom_scripts'); |
1 2 3 4 |
<button id="show-content">Show Content</button> <div id="hidden-content" style="display:none;"> This is the hidden content that will be revealed on click. </div> |
1 2 3 4 5 |
jQuery(document).ready(function($) { $('#show-content').on('click', function() { $('#hidden-content').toggle(); }); }); |
This code will hide the content initially, and then show it when the button with id "show-content" is clicked.
Remember to always test your code to ensure it works as expected on your Wordpress site.