Can I populate only certain blog categories on pages?
-
I am setting up specific pages for specific topics and would like to have only the blogs with certain categories populate on these pages.
How would I go about doing that?
-
You should be creating a new page template with a custom query and assign the template to your specified pages.
Hmm, I’ve never done that before, do you know of a good walk-thru?
That’s a bit of coding i would recommend that, But you want a plugin to solve your issue you can use https://wordpress.org/plugins/list-category-posts/ and the list of categories would be displayed with a shortcode [catlist name=apples+oranges]
Ahh yeah I’m not a programmer so a plugin is def a must for me, that sounds like it would work for me, I will try it out and let you know if I have any problems.
Thank you!
Ok that seemed to work perfect, however it lists them as just a list, is there a way to populate them so they are the visually appealing blog post with the Featured Image, date, brief description etc?
Also, the part of the category code I want to be using is the “slug” correct?
[catlist name=”oneill”]
The Category Name: Justice Bill O’Neill
The Category Slug: oneillSlug = code to enter in the catlist shortcode quote correct?
There is a list of parameters https://github.com/picandocodigo/List-Category-Posts/wiki/More-parameters-you-can-use
To display post with thumbnail and content/excerpt [catlist name=”catgory_slug” excerpt=yes content=yes thumbnail=yes ]
Hmm this is weird, on this page the particular category populates correctly:
http://www.ohiocannabis.com/hb523
[catlist name=”hb523” thumbnail=yes excerpt=yes]
But this page is displaying additional blog posts from other categories when I only have 1 particular category in the code and only 1 blog assigned to the crypto slug:
http://www.ohiocannabis.com/crypto/
[catlist name=”crypto” thumbnail=yes excerpt=yes]
This page should only be displaying the 1 blog post about Cannabis Cryptocurrency: Potcoin
Not sure how or why the others are showing up, how can we fix that? This is the only page having issues with displaying the correct categories.
Any any idea on how to fix the images?
-
This reply was modified 8 years ago by
JohnnyScience.
-
This reply was modified 8 years ago by
JohnnyScience.
-
This reply was modified 8 years ago by
JohnnyScience.
Nevermind that last post, seems there must have been something hidden in the copy/paste and I redid all the individual page list codes and they are populating fine now.
But it would be nice to have the images show up in a more visually appealing way instead of just right in the middle.
I’m trying to follow this walk-thru for a template setup:
I uploaded the folder & files it told me to:
wp-content\themes\child-theme\list-category-posts\perfectlist.php
But as I follow along, I don’t understand how to get it to use the template, they said use the code:
[catlist name=”crypto” excerpt=yes thumbnail=yes template=perfectlist]
But it doesn’t seem to populate? ohiocannabis.com/crypto
It seems I have to add some CSS to the template? Do I add it direcly to the perfectlist.php file? Or some where else?
-
This reply was modified 8 years ago by
JohnnyScience.
Child theme should be extending your activated Theme. You don’t need a template now you can simply add CSS rules and fix the layout try adding this css
#dslc-theme-content-inner .lcp_catlist{ list-style:none !important; margin:0; } .lcp_catlist li img.wp-post-image{ float:left !important; display:inline-block; margin-right:15px; }Nevermind I figured it out. Ok thank you!
What should I do to separate multiple blog entries so they’re not smashed together?
-
This reply was modified 8 years ago by
JohnnyScience.
http://www.ohiocannabis.com/cbd/
See like on that page for instance, only the 1st article has a picture attached, but it looks as if all 3 of them are attached to that picture.
How can we divide them with borders to make it look nicer?
Add default images for those posts without thumbnail. you need to add to each post. if you have a default image in your theme options you can use it.
.lcp_catlist li{ margin-bottom:20px; display:block; width:100%; clear:both; }add the above CSS this enables you to display each post separate with adequate spacing.
Great, thank you!
-
This reply was modified 8 years ago by
The topic ‘Can I populate only certain blog categories on pages?’ is closed to new replies.