diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 17c82f6..0fcb862 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -5,7 +5,7 @@
{{- $pluginVen := $P.vendors.plugins -}}
{{- $pluginCDN := index $vendors $pluginVen -}}
{{- .Scratch.Set "pluginCDN" $pluginCDN -}}
-{{ $posts := len .Site.RegularPages }}
+{{ $posts := len (where .Page.Site.RegularPages "Section" "in" .Site.Params.mainSections) }}
{{- .Scratch.Set "posts" $posts -}}
@@ -31,7 +31,7 @@