AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Solved] Anchor links to quoted posts

5 Posts
2 Users
4 Reactions
3,073 Views
Wendell
Posts: 252
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@wendell)
Reputable Member
Joined: 9 years ago
[#18922]

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.

quote link

4 Replies
Chris
Posts: 3610
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@chris)
Famed Member
Joined: 5 years ago

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 } );

 


2 Replies
Wendell
(@wendell)
Joined: 9 years ago

Reputable Member
Posts: 252
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@chris 

Wow! Thank you for this. 🙂

I've implemented it with a custom functions plugin and it works great.

If I may be so bold, do you think it could be implemented with an icon and link instead of the entire blockquote box? https://share.getcloudapp.com/4guP5q9k (just a thought, certainly not required) 🙂


Chris
(@chris)
Joined: 5 years ago

Famed Member
Posts: 3610
Chris
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@wendell,

There are many changes needed for that, not only coding also design, so it will take time to finish the work, we have added it in our to-do list, so it will be added in wpForo 2.0.0 update.


Wendell
Posts: 252
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@wendell)
Reputable Member
Joined: 9 years ago

Thanks Chris! 🙂


Share: