Last active
May 12, 2021 19:26
-
-
Save wvfitzgerald/1db28f847782ca943e36da698df082f5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /*------Add a Read More link in single post/pages--------*/ | |
| function mhw_wvf_read_more_link(){ | |
| ?> | |
| <script type="text/javascript"> | |
| function toggleDisplay(id,a) | |
| { | |
| var elaboration = document.getElementById(id); | |
| if (elaboration.style.display === "block") | |
| { | |
| elaboration.style.display = "none"; | |
| if(a) a.innerHTML=" Read more..."; // won't work with target=_self | |
| } | |
| else | |
| { | |
| elaboration.style.display = "block"; | |
| if(a) a.innerHTML = " Read Less..."; | |
| } | |
| } | |
| </script> | |
| <style type="text/css"> | |
| .toggleLink { | |
| color: navy; | |
| text-decoration: underline; | |
| } | |
| .toggleLink:hover { | |
| cursor: pointer; | |
| } | |
| .elaboration { | |
| display: none; | |
| } | |
| </style> | |
| <?php | |
| } | |
| add_action('wp_footer', 'mhw_wvf_read_more_link' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment