Hi Tuanphan,
I hope you’re doing well! I wanted to follow up on the issue we previously discussed regarding the category highlighting on our blog.
We’ve tried a few different approaches since our last message, but unfortunately, the issue persists. Specifically, when navigating through paginated pages within a selected category (for example, https://giulianodipaolo.com/blog?offset=1708948696562&category=mindset), the category highlighting resets, and instead of remaining on the correct category, the "All" category gets highlighted again.
Here's one of the JavaScript solutions we attempted to dynamically highlight the selected category, but it didn't resolve the issue:
javascript
Copy code
document.addEventListener("DOMContentLoaded", function() { var urlParams = new URLSearchParams(window.location.search); var category = urlParams.get('category'); if (category) { var menuItems = document.querySelectorAll('.nav-folder-contents a'); menuItems.forEach(function(item) { if (item.href.includes(category)) { item.style.color = '#000'; // Set text color to black item.style.backgroundColor = '#FEC700'; // Set background color item.style.fontWeight = 'bold'; // Set font weight to bold } }); } });
Unfortunately, this approach did not work, and the category highlighting issue persists when navigating through paginated pages.
Could you kindly provide any further guidance or suggestions on how we might resolve this? We truly appreciate your ongoing support and assistance.
Thank you in advance for your help!
Best
Giuliano