Community Forums › Forums › Archived Forums › Design Tips and Tricks › Metro Pro – Inserting a tag around "Next / Previous"
Tagged: exclude tags, next previous
- This topic has 2 replies, 2 voices, and was last updated 6 years, 9 months ago by
Tribulatio.
-
AuthorPosts
-
March 20, 2019 at 5:10 am #490153
Tribulatio
ParticipantOn one of my sites, built with Metro Pro, I have the snippet showing the title of the previous and of the next article at the bottom of each post.
On that specific site, I am not using WP's own search tool, but the paid version of an external search tool, FreeFind, that is more adequate for my needs (moreover, it allows the search results to appear in a nice way as overlay).
However, I have realized that FreeFind also indexes the "next / previous" titles at the bottom of each post, which is misleading for visitors, since those are only titles, and not content.
FreeFind provides exclude tags for such cases:
<!-- FreeFind Begin No Index -->
<!-- FreeFind End No Index -->My problem is: where to insert those tags in order to make them work? In which file in the child theme folder? (I would also like to insert one or two empty lines with <br> below the next / previous links.)
I had the same issue with the sidebar, since its content got indexed as well. However, I managed to solve the issue by inserting the exclude tags at the beginning of the first and at the end of the last widget (fortunately, both were HTML widget) — although it would be cleaner to insert those tags in the appropriate child theme file, but here again, I have not managed to find where.
https://www.terrorisme.netMarch 20, 2019 at 5:34 am #490154Victor Font
ModeratorThe adjacent-entry-pagination content is built using genesis_markup. This means when the content is created, two apply_filters are also created. They are:
genesis_markup_adjacent-entry-pagination
genesis_markup_adjacent-entry-pagination_outputYou can probably use either one to add your comments, but I would use the genesis_markup_adjacent-entry-pagination_output filter.
You may need to adjust this for your purposes, but adding this to functions.php should work for you:
add_filter('genesis_markup_adjacent-entry-pagination_output', 'add_freefind_exclude_tags'); function add_freefind_exclude_tags( $tag ) { return "<!-- FreeFind Begin No Index -->" . $tag . "<!-- FreeFind End No Index -->"; }
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?March 31, 2019 at 9:26 am #490384Tribulatio
ParticipantI apologize for not having acknowledged receipt of your answer earlier.
Many thanks for your answer and for this very useful information. I would not have been able to find it by myself. I will test it soon, when I do the next reindexing of the website: I assume that it will work fine, and otherwise I will let you know.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.