Hello,
I have an unordered list of my blog post tags on a page in WordPress. Underneath the list, I have a results div where, when a tag is clicked, I’d like to display a list of posts that have that tag. I would like this to happen without reloading the page. I can’t figure out how to access a list of posts through jQuery. Any help would be fantastic!
Here is my code:
<ul id="tagList">
<li><a href="#">Rock</a></li>
<li><a href="#">Blues</a></li>
<li><a href="#">Jazz</a></li>
<li><a href="#">Country</a></li>
<li><a href="#">Classical</a></li>
</ul>
<div id="results">
<ul>
<!-- If "Rock" is clicked, it would show an <li><a href="/link-to-blog-post/">Post Title</a></li> for each post with the tag "Rock". -->
</ul>
</div>