- This topic has 29 replies, 4 voices, and was last updated 4 years, 11 months ago by Tom.
-
AuthorPosts
-
April 25, 2019 at 4:14 pm #879758TomLead DeveloperLead Developer
Did these issues only start happening once we added the second function?
April 26, 2019 at 12:39 am #880012DeepWell 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/nh3ippApril 26, 2019 at 9:16 am #880635TomLead DeveloperLead DeveloperI 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?April 26, 2019 at 11:51 am #880786DeepWell, 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/nhcxegI think the excerpt in the shortcode needs to be defined as you have done in the case of date
April 26, 2019 at 6:19 pm #881036TomLead DeveloperLead DeveloperHmm, the excerpt is already using that same method. Is this the same for all single posts?
April 26, 2019 at 6:57 pm #881049DeepYes its happening on all the single post page. Have a look at my website https://bihog.com
April 27, 2019 at 7:12 am #881470TomLead DeveloperLead DeveloperApril 27, 2019 at 8:39 am #881561DeepHi,
After updating the new code it is showing some fatal error. See the screenshot
http://prntscr.com/nhmywzApril 27, 2019 at 3:04 pm #881754TomLead DeveloperLead DeveloperSorry about that, can you try again?
April 27, 2019 at 8:48 pm #881863DeepAlmost 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/nhsyvfBut 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?
April 28, 2019 at 8:23 am #882383TomLead DeveloperLead DeveloperApril 28, 2019 at 9:04 am #882416DeepWell, the excerpt is only showing the number 30. Have a look at the screenshot.
http://prntscr.com/nhygwzApril 28, 2019 at 9:44 am #882438TomLead DeveloperLead DeveloperSorry about that, can you try now?
April 29, 2019 at 1:04 am #882867DeepMany 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/ni6vyiApril 29, 2019 at 8:33 am #883370TomLead DeveloperLead DeveloperGlad I could help! 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.