Archived topic
Blog layout archive by Elements
5 replies · Started by Jusung on July 26, 2022
Hello.
When you see my blog page on my website,
you can find 2 contents.
It is showing 2 categories.
However, I want to show only one category.
I don't want to show the parent category.
Is there a way to show the parent category?
On the elements, I can add CSS there maybe??
The other problem is the size of picture.
I only use 300x200 size of picture.
When it is desktop or table, there is no problem.
However,when you see the featured image on mobile,
there is around 20% empty place and I don't want any empty place.
Your Sincerely,
Hi Jusung,
To clarify, you only want to show posts from a specific category in your blog page?
One way to have full control of an archive page is to simply create a static page. Just use a GenerateBlocks Query Loop Block inside to query the specific posts you prefer.
You can add CSS through a Hook Element but it’s better to add it in Additional CSS or a child theme stylesheet.
For CSS, try adding my-container to the Container Block holder the image, and then add this CSS in additional CSS:
@media (max-width: 768px) {
.gb-container.my-container img {
width: 100%;
height: auto;
}
}
Hope this helps!
Hello. the size of image has been solved.
There is one more request that is not solved.
As you can see the blog page, you can see 2 categories on the content.
I want to show only one category.
Is there any way to show one category?
One approach to do this is to remove the term separator in your Headline Block for the categories, the add this CSS:
.blog .dynamic-content-template .dynamic-term-class .post-term-item:not(:first-of-type) {
display: none;
}
Hope this helps!
Hello. it has been solved
However, this is not applied to all pages such as search page.
So, I removed the ".blog".
Will it be ok to remove .blog?
.blog .dynamic-content-template .dynamic-term-class .post-term-item:not(:first-of-type) {
display: none;
}
Yes. That’s alright if you want to apply it to all pages that are using a Content Template and a dynamic term Headline Block. :)