-
AuthorPosts
-
November 26, 2016 at 10:13 am #717169
Hi there,
I would very much like to know how I can add the excerpt to a single post on the front end.
I don’t want to use the advanced layout editor. I’ve added some content to the excerpt meta box and now I want to show it on the full article display.
Thanks!
November 26, 2016 at 10:50 am #717177Hey Webfixers,
Would you mind providing a precise link to your site, showing which post you need to add excerpt? We need to be able to inspect them in order to help :)
Best regards,
Vinay- This reply was modified 7 years, 11 months ago by Vinay.
November 26, 2016 at 7:18 pm #717245Hi Vinay,
sure no problem.
November 28, 2016 at 10:37 pm #718021Hi!
I am not sure if i understood the changes you would like to make clearly. Your blog overview page shows the excerpt of your post at the moment. Can you please elaborate on the changes you would like to make?
Best regards,
YigitNovember 29, 2016 at 12:35 am #718061Hi!
I’d like the excerpt to also be shown a the single page view of the post.
Thanks for helping out!
December 2, 2016 at 1:25 pm #719659Hi,
this is about WordPress default behavior (and not about a theme issue). So check out how WordPress is controling excerpt function:
http://www.wpbeginner.com/wp-themes/how-to-display-post-excerpts-in-wordpress-themes/
https://codex.wordpress.org/ExcerptBest regards,
AndyDecember 5, 2016 at 11:42 am #720413Hi Andy,
In this case it is actually theme behavior as I am trying to add the excerpt to a page template to show it on the front end.
I have added content to the excerpt meta box in the admin, and now I’d like to show it on the front end. I will send you a private link to the page I am trying to get this to work on.
Thanks
December 6, 2016 at 8:17 am #720873Hi,
It’s not clear what you are trying to achieve. However it appears you are trying to add an excerpt to a single blog post entry and not on the blog post archive page ? Is that correct?
Wordpress do not allow this but if you think this is a theme feature as seen here http://kriesi.at/themes/enfold-overview/ please share the link to the page (close the iframe before copying the URL) and we will surely help you achieve the same :)
If you do not see on our demos please point us to any other site where you see what you are trying to achieve.
Also let us know what is the purpose you are trying to add an excerpt to a single blog post ?
Thank you for reaching out to us, happy to help :)
Best regards,
VinayDecember 6, 2016 at 9:53 am #720903Hi Vinay,
thanks for your elaborate response and sorry for the confusion.
what I am trying to achieve is to have the excerpt automatically added to the full single posts display on the front end to use it as ‘lead text’ (intro) to the article so I can easily make it stand out with CSS. That way the user doesn’t have to manualy add styling to the lead text of every article to make it stand out.
My thinking is this: if the user is going to the trouble of writing a summary in the excerpt meta box you might as well use that as lead/intro text on the full article page. With the added benefit of being able to easily add some css (bold and slighly larger font for instance) to make it stand out.
If you think there is a better, more user friendly way of achieving this, let me know.
Kind regards
December 8, 2016 at 9:45 pm #722193Hi,
You can try creating a shortcode such as following one
function my_custom_excerpt() { if(is_single()){ ob_start(); $output = "<span class='custom-excerpt'>". the_excerpt('',false) ."</span>"; $output = ob_get_clean(); echo $output; } } add_shortcode( 'custom_excerpt', 'my_custom_excerpt' );
and then add [custom_excerpt] to top of your posts and adjust the styling using
.custom-excerpt { font-size: 20px; font-weight: bold; }
Best regards,
Yigit -
AuthorPosts
- You must be logged in to reply to this topic.