-
AuthorPosts
-
May 31, 2013 at 6:17 pm #24145
Hey,
I was wondering how I can change the View of the Mainpage of the blog. Normaly there is the content stripped after a few words. How can I change it to an excerpt, e.g. without any picture I used at the beginning of a post?
It should look like that at first the post thumbnail is shown, then only the excerpt (without any html and pictures and other stuff) and then a link, where the user can go to the whole post.
Would be great if you can help!
June 1, 2013 at 3:11 am #122519Hi,
First, go to Enfold > Blog Style > Blog Style, select the “Single Author, big preview Pic (no author picture is displayed, feature image is big)”. You can specify the excerpt manually, just edit a post, look for the Screen Options (top right corner). Check the Excerpt option.
Regards,
Ismael
June 1, 2013 at 9:08 am #122521Hi Ismael,
thanks for your quick reply. I already set “Single Author, big preview Pic (no author picture is displayed, feature image is big)” and manually set the excerpt via “<!–more–>”-Tag. I can’t change it through the excerpt option because I already have over 2k posts and don’t want to change post by post.
Is there another way for working with the “<!–more–>”-Tag?
June 2, 2013 at 6:14 am #122522Yes – open up wp-contentthemesenfoldincludesloop-index.php and replace
$current_post['content'] = $blog_content == "content" ? get_the_content(__('Read more','avia_framework').'<span class="more-link-arrow"> →</span>') : get_the_excerpt();
with
$current_post['content'] = get_the_content(__('Read more','avia_framework').'<span class="more-link-arrow"> →</span>');
June 2, 2013 at 6:28 am #122523Hey Dude,
thanks – that helps a little ;) Now I have only the problem, that images I used at the beginning of a post are shown at the first page too. In combination with the post thumbnails it looks really bad. Is there any way that not the content will be shown but a real excerpt (only text, no images, no html-codes, …)??
June 3, 2013 at 5:46 pm #122524Hi ppc1337,
If you change get_the_content to get_the_excerpt it will return the excerpt field for the post.
Regards,
Devin
June 4, 2013 at 5:24 am #122525Hey Devin,
I tried this already. The content is diplayed through “echo $content”. I tried to change it to get_the_excerpt and the_excerpt – but then nothing is displayed
June 4, 2013 at 5:43 am #122526You can try following code:
$current_post['content'] = $blog_content == "content" ? get_the_content(__('Read more','avia_framework').'<span class="more-link-arrow"> →</span>') : strip_tags(get_the_content(__('Read more','avia_framework').'<span class="more-link-arrow"> →</span>'));
June 4, 2013 at 7:23 am #122527Hm … that changed nothing :( Would it be helpfull if you log in to my site and have a look by yourself?
June 4, 2013 at 7:27 am #122528Hey!
Then try:
$current_post['content'] = get_the_content(__('Read more','avia_framework').'<span class="more-link-arrow"> →</span>');
if(!is_single())
{
$current_post['content'] = strip_tags(get_the_content(' '));
$current_post['content'] .= '<div class="read-more-link"><a href="'.get_permalink($the_id).'" class="more-link">'.__('Read more','avia_framework').'<span class="more-link-arrow"> →</span></a></div>';
}Best regards,
Peter
June 4, 2013 at 7:45 am #122529Dude, you are awsome! Works perfectly!
June 4, 2013 at 9:02 am #122532Hey!
I changed the code a bit to include a read more link.
Best regards,
Peter
June 4, 2013 at 11:51 am #122533Now it’s absolutly perfect – thanks a lot!!
-
AuthorPosts
- The topic ‘How to get Excerpt in loop_index.php’ is closed to new replies.