Archived topic
I want to display Archive Content Title (H2) with limited words
7 replies · Started by Immi on August 11, 2020
Hi, I am trying to display the shortened titles on the homepage (archive pages) only. I want to limit the titles to lets say 15 characters and then if the title is longer than that, it should display three dots after 15 characters.
My friend is using Astra Theme he was saying in Astra have a feature to get it.
I am also attaching a screenshot of the homepage of his website for example. Please let me know how to achieve it without plugin in GP
https://www.screencast.com/t/ztpkoLKpx
Thanks!
Hi there,
You could use CSS to give the title a max-width:
h2.entry-title {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
max-width: 200px;
}
Let me know :)
Hi Tom
Thanks, CSS Worked. I have another question related to it could you please suggest. If I keep shortened titles on the homepage, will it negatively affect SEO?
2) I’m using read more as a button and excerpt word count set is 0, is there any chance to remove 3 dots above the download button?
**
If I use CSS the following CSS to remove 3 dots, then button also removed with 3 dots. I want to keep the button and remove the 3 dots.
.entry-summary {
display: none;
}
Website: **
Thanks!
Hi there,
use this CSS to hide the ... 3 dots:
.entry-summary p:not(.read-more-container) {
visibility: hidden;
}
Hidden content will still be indexed by google bot. But google also takes a snapshot of what it sees and this image is given greater precedence over the indexed content. I assume the same for other Search engines. So yes, hiding the the title may have an SEO impact.
Thank you David, work fine!
I need another help from you!
I'm displaying my posts in Columns; they are showing well on PC but not in mobile devices. Posts are showing in a single column on mobile devices and I want to display them in 2 columns same as like below-attached screenshot.
can you help me in displaying Archive layout posts in 2 columns for mobile devices?
Thanks!
Try this:
@media(max-width: 768px) {
.post.generate-columns.mobile-grid-100 {
width: 50%;
padding-left: 10px;
padding-right: 10px;
}
}
Hi David,
Thanks for your help, it worked perfectly.
Regards
Immi
Glad to hear that