Related Posts
Filter By Category or Tag
To filter posts by category or tag, add two blocks of the plugin code, one with enabled "Filter By Category Only" option, and the second with enabled "Filter By Tag Only" option. For example:
<!-- Plugin Related Posts --> <script src="/s/plugin-related-posts.js"></script> <script>pluginRelatedPosts({"filterByCategoryOnly":"true"});</script> <!-- end Plugin Related Posts --> <!-- Plugin Related Posts --> <script src="/s/plugin-related-posts.js"></script> <script>pluginRelatedPosts({"filterByTagOnly":"true"});</script> <!-- end Plugin Related Posts -->
Add this code after the plugin code:
<!-- Plugin Related Posts - Filter by category or tag --> <!-- Author: Dmytro Kyselov https://dmytrokyselov.com/ --> <style>.c-related-posts + .c-related-posts { display: none !important }</style> <script>function filterByCategoryOrTag(){var relatedPosts=document.querySelector(".c-related-posts + .c-related-posts");if(!relatedPosts)return null;var mainList=document.querySelector(".c-related-posts .summary-item-list"),items;[].slice.call(relatedPosts.querySelectorAll(".summary-item")).forEach((function(item){var link=item.querySelector("a[href]");mainList.querySelector('a[href="'+link.getAttribute("href")+'"]')||mainList.appendChild(item)}));var gallery=Y.one(mainList).getData("gallery");gallery&&gallery.destroy()}window.addEventListener("RelatedPostsAdded",filterByCategoryOrTag)</script> <!-- end Plugin Related Posts - Filter by category or tag -->
Add Space Above
To add extra space above related posts, add this code under the plugin code:
<!-- Plugin Related Posts - Add a gap above --> <style> .view-item .c-related-posts__heading { margin: 50px 0 -17px; } </style> <!-- end Plugin Related Posts - Add a gap above -->
Change Font Family
To change the font family for related posts, add this code under the plugin code and change the "FontName" to the desired font family.
<!-- Plugin Related Posts - Change Font --> <style> .view-item .c-related-posts { font-family: FontName; } </style> <!-- end Plugin Related Posts - Change Font -->