I am trying to use simplemodal to have modal popups with text in wordpress posts. I've played around with various plugins but they have specific uses (such as the contact form, or another one I saw that displays a single note you can customize).
I've tried following this tutorial: http://wordpressthemescollection.com/ajax-wordpress-post-popup-with-simplemodal-and-jquery-488.html but the instructions are not very clear for people without advanced jquery or wordpress knowledge and it simply isn't working for me. The author does not explain where you put the function, for instance.
For anyone who's gotten simplemodal working in wordpress, without developing a plugin, can you please assist? Thank you.
The tutorial is a good start on a solution, but does not quite provide all of the details. There are also some changes that I would make. Here is what I would do to get it working:
postpopup
class and has the post ID in therel
attribute.js/
folder in your theme directoryjs/
foldersite.js
) and place it in thejs/
foldersite.js
:.
functions.php
file:.
That should get it working for you. Make sure you have the
wp_footer()
function in your theme's footer. I re-worked the way the modal window was being called so that the auto-centering of the content works.