Archived topic
Display post for a Category in home page
2 replies · Started by Tinghua Huang on July 28, 2018
Hi, I have a question about display post for a Category in home page
I am using the sider library, everything works fine for me except in home page I only want to display post for a specific Category named "home-page", I did a few research for the GeneratePress doc
here is my code:
add_filter('generate_blog_columns', 'generate_custom_post_archive_columns');
function generate_custom_post_archive_columns($columns)
{
if (is_category('home-page')) {
return true;
}
return $columns;
}
But my site is still looks like this, the first two post is belongs to "Uncategorized", but they are been displyed, what I am doing wrong? Please help, thanks a lot.
I think I have almost reached my goal, after I install "WP show posts", the great plugin writen by Tom, things became much more easier, but my home page (http://39.106.141.251/wordpress/), has a header in the content area (HOME PAGE and a hyphen at the second line), I don't want that, dose any one know how to remove it, thanks!
Hi there,
You can remove the title using the "Disable Elements" section of the "Layout" metabox: https://docs.generatepress.com/article/layout-metabox-overview/
To remove the line, go to "Customize > Additional CSS" and remove this CSS:
.single .entry-header::after, .page .entry-header::after {
border-bottom: 1px solid #000;
content: "";
display: block;
margin-bottom: 40px;
padding-bottom: 40px;
width: 2.5%;
}
Hope this helps :)