Oct 18, 2021 7:37 pm
When someone replies with a quote, it would be great if a link could be added to the quote somehow that would take you back to the quoted text (see attached image).
If that's not possible, perhaps the quoted text could just link back to the post quoted from instead of the specific text within the post.
4 Replies
Oct 19, 2021 11:49 am
Hi @wendell,
1. Download and Install "Code Snippets" Plugin for WordPress
2. Open Dashboard > Snippets > Add NewÂ
3. Write a Title
4. Add the Below Code, Check the "Only run on site front-end" Checkbox and press Save Changes and Activate
add_action( 'wp_footer', function () { ?> <script> jQuery(document).ready( function($){ let blockquotes = $('blockquote[data-postid]'); blockquotes.css('cursor', 'pointer'); blockquotes.on('click', function(){ let postid = parseInt( $(this).data('postid') ); if( !isNaN(postid) ) window.location.hash = 'post-' + postid; }); }); </script> <?php } );
Â
Oct 20, 2021 12:48 pm
Thanks Chris! 🙂