Skip to content

Commit d5f90c9

Browse files
author
Rodrigo Techera
committed
adding functionality to display and hide posts module by tags
1 parent 0cc4b71 commit d5f90c9

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

_includes/blog_tags_filter.html

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
if(jQuery(this).data("tag") == "all") {
1010
jQuery(this).addClass("all-tag-selected");
11+
1112
jQuery('.blog-tag-container').fadeOut('fast', function () {
1213
jQuery('.blog-posts-nav').fadeIn('fast');
1314
});
14-
1515
} else {
1616
jQuery(this).addClass("selected");
1717

18-
jQuery('.blog-tag-container[data-tag="'+jQuery(this).data("tag")+'"]').siblings().fadeOut('fast', function () {
18+
jQuery('.blog-tag-container div[data-tag="'+jQuery(this).data("tag")+'"]').siblings().fadeOut('fast', function () {
1919
jQuery(this).fadeIn('fast');
2020
});
2121

@@ -27,6 +27,10 @@
2727
});
2828
</script>
2929
<style>
30+
.blog-container, .blog-tag-container {
31+
width: 100%;
32+
}
33+
3034
.blog-container .blog-vertical .blog-filter-menu .filter-btn {
3135
color: #979797;
3236
border: 1px solid #979797;
@@ -65,14 +69,15 @@
6569
<div class="blog-filter filter-btn filter" data-tag="{{ tag }}">{{ tag }}</div>
6670
{% endfor %}
6771
</div>
68-
{% for tag in site.tags %}
69-
<div class="blog-tag-container" data-tag="{{ tag[0] }}">
70-
{% for post in tag[1] %}
72+
<div class="blog-tag-container">
73+
{% for tag in site.tags %}
74+
<div data-tag="{{ tag[0] }}">
75+
{% for post in tag[1] %}
7176

72-
{% include blog_post_nav.html %}
73-
74-
{% endfor %}
75-
</div>
76-
{% endfor %}
77+
{% include blog_post_nav.html %}
78+
79+
{% endfor %}
80+
</div>
81+
{% endfor %}
7782
</div>
78-
{% endif %}
83+
{% endif %}

0 commit comments

Comments
 (0)