diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 4a998d3c..d788753e 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -17,7 +17,7 @@
{{- end}}
{{ $paginator := .Paginate $pages }}
-
+{{ $term := .Data.Term}}
{{- range $index, $page := $paginator.Pages }}
{{- $class := "post-entry" }}
@@ -27,7 +27,7 @@
{{- else}}
{{- $class = "first-entry" }}
{{- end }}
-{{- else if .Data.Term }}
+{{- else if $term }}
{{- $class = "post-entry tag-entry" }}
{{- end }}