[Resolved] Latest Post in the header element

Home Forums Support [Resolved] Latest Post in the header element

Home Forums Support Latest Post in the header element

Viewing 15 posts - 16 through 30 (of 30 total)
  • Author
    Posts
  • #879758
    Tom
    Lead Developer
    Lead Developer

    Did these issues only start happening once we added the second function?

    #880012
    Deep

    Well not exactly. I found the reason that it’s because of the Cache dynamic CSS settings. Once I unchecked it the duplication error gone. But I realized two things out of this.
    1) We have to write manual excerpts within the post to reflect in the header element, else it remains blank (auto excerpts are highly appreciated like post archives).
    2) It was overlooked. The code to get_the_date is returning the publishing date of the page where the element is located. I need the date of the post displaying in the header element i.e. the latest post.
    For better understanding, you can have a look at the screenshot http://prntscr.com/nh3ipp

    #880635
    Tom
    Lead Developer
    Lead Developer

    I just adjusted the code so the date should work: https://generatepress.com/forums/topic/latest-post-in-the-header-element/#post-876757

    get_the_excerpt() shouldn’t require manual excerpts – it should grab them from your content. I wonder if there’s a plugin conflicting? Can you try deactivating your other plugins to test?

    #880786
    Deep

    Well, the date problem is solved. But interestingly I find the fault with the code regarding the excerpt. It is the same way the date was displaying, the excerpts are showing/not showing (depends) in the header element.

    See on the front page I am using WP Show Post shortcode, hence it could not find any excerpt to show. Here is the screenshot http://prntscr.com/nhcufm

    But in the case of the single post page, the header element shortcode is picking up the excerpt where the header element is located and not of the post displaying in the header.
    It will clear from this screenshot http://prntscr.com/nhcxeg

    I think the excerpt in the shortcode needs to be defined as you have done in the case of date

    #881036
    Tom
    Lead Developer
    Lead Developer

    Hmm, the excerpt is already using that same method. Is this the same for all single posts?

    #881049
    Deep

    Yes its happening on all the single post page. Have a look at my website https://bihog.com

    #881470
    Tom
    Lead Developer
    Lead Developer
    #881561
    Deep

    Hi,
    After updating the new code it is showing some fatal error. See the screenshot
    http://prntscr.com/nhmywz

    #881754
    Tom
    Lead Developer
    Lead Developer

    Sorry about that, can you try again?

    #881863
    Deep

    Almost done except this first ‘Read more’ button which is targeting the same page where the header element is located and not the post title and excerpt displaying in the header element. Have a look into the screenshot.
    http://prntscr.com/nhsyvf

    But the second ‘Read more’ button is ok- targeting the single post page displaying in the header element.

    Look at this link below to understand the things https://bihog.com/tcil-recruitment-2019-last-date-14-may-2019/

    P.S.: Can we limit the length of the characters in the excerpt?

    #882383
    Tom
    Lead Developer
    Lead Developer
    #882416
    Deep

    Well, the excerpt is only showing the number 30. Have a look at the screenshot.
    http://prntscr.com/nhygwz

    #882438
    Tom
    Lead Developer
    Lead Developer

    Sorry about that, can you try now?

    #882867
    Deep

    Many many thanks.
    The problem has been sorted out. I really appreciate your patience and skill.
    Thank you very much. Have a look at the screenshot http://prntscr.com/ni6vyi

    #883370
    Tom
    Lead Developer
    Lead Developer

    Glad I could help! 🙂

Viewing 15 posts - 16 through 30 (of 30 total)
  • You must be logged in to reply to this topic.