[Resolved] I want to display Archive Content Title (H2) with limited words

Home Forums Support I want to display Archive Content Title (H2) with limited words

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1397692
    Immi

    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
    Capture.JPG

    Thanks!

    #1397939
    Tom
    Lead Developer
    Lead Developer

    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 šŸ™‚

    #1398776
    Immi

    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?

    GP.JPG

    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: https://gomodapk.com/

    Thanks!

    #1398873
    David
    Staff
    Customer Support

    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.

    #1399612
    Immi

    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!

    #1400281
    David
    Staff
    Customer Support

    Try this:

    @media(max-width: 768px) {
        .post.generate-columns.mobile-grid-100 {
            width: 50%; 
            padding-left: 10px; 
            padding-right: 10px;
        }
    }
    #1400714
    Immi

    Hi David,

    Thanks for your help, it worked perfectly.

    Regards
    Immi

    #1400725
    David
    Staff
    Customer Support
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.