Show Posts from Specific Category on Homepage

Hi,

I’ve explored the whole forum, but didn’t get the solution of this!

I want to show first 3 post from a speicifc cateogry on homepage.

I’ve tried a lot of options but noting really works! Here’s what I tried.

{{ range first 3 (where .Site.Pages ".Params.category" "eq" "News") }}
  <a href="{{.Permalink}}">{{.Title}}</a>
{{end}}
{{ range first 3 .Site.RegularPages }}
{{if in .Params.category "Motherboards"}}
  <a href="{{.Permalink}}">{{.Title}}</a>
{{end}}
{{end}}
{{ range .Site.Taxonomies.category.Motherboards }}
  <a href="{{.Permalink}}">{{.Title}}</a>
{{end}}

Please anyone help me with the write code.

This code return no error but the posts doesn’t show!

{{ range where .Site.RegularPages "Params.categories" "intersect" (slice "Motherboards") }}
1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.