- This topic has 9 replies, 3 voices, and was last updated 1 month ago by Leo.
August 16, 2020 at 12:24 am #1404648Vishvendra
On this blog post I needed to add featured image after the first paragraph the italic one.
Also, I want the top separator line after author name to be inserted by default. So I don’t need to add it every time I create blog post.
I tried to do it with elements but was unable to do it. Please don’t ask how I tried to do it. 😋 I just tried.
So, what’s the correct way. How Can I achieve it.
ThanksAugust 16, 2020 at 6:05 am #1404882DavidStaffCustomer Support
the simplest method would be to add that text to the Excerpt field in the post editor. This will also be displayed in the Archive post excerpt.
Then create a hook
Add this content:
<?php if ( has_excerpt() ) : // Only show custom excerpts not autoexcerpts ?> <p class="entry-subtitle"><?php echo get_the_excerpt(); ?></p> <?php endif; ?>
Check Execute PHP
Set Display Rules to Posts > All Posts
Then in Customizer > Layout > Blog –> Featured Images >>> Set its location to Below Title.August 16, 2020 at 6:19 am #1404910Vishvendra
Thanks, I will try that now and let you know how well things went.
Thanks again. 🙏🏻August 16, 2020 at 7:43 am #1404984DavidStaffCustomer SupportAugust 18, 2020 at 6:28 am #1407650Vishvendra
okay, I tried to create the hook with the code you’ve provided.
(1) I didn’t find the Execute PHP option.
(2) there generate_after_entry_header hook was present not after_entry_header.
(3) Want to show read more link text on the archive but custom excerpt doesn’t let it.
The option came. However, blog post looks likes this https://mouthpost.com/pradhan-mantri-garib-kalyan-yojana/
no space between meta text and title. Plus text doesn’t coming up in italic fonts. I also want to add separator after the meta text.
Thanks 🙂August 18, 2020 at 6:47 am #1407685DavidStaffCustomer SupportAugust 18, 2020 at 5:46 pm #1408623Vishvendra
Thanks, it worked. But how to bring back read more link at the archive page. As custom excerpt overwriting it.August 18, 2020 at 8:20 pm #1408721LeoStaffCustomer Support
I believe this is what you are after:
If not please open a new topic as the original topic is resolved.
Thanks!August 19, 2020 at 6:30 pm #1410301Vishvendra
Thank you Leo and David for the awesome support. All issue resolved. Will bug in the future. 😀August 19, 2020 at 7:55 pm #1410342
- You must be logged in to reply to this topic.