Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #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!

    #122519

    Hi,

    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

    #122521

    Hi 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?

    #122522

    Yes – 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">  &rarr;</span>') : get_the_excerpt();

    with

    $current_post['content'] 	= get_the_content(__('Read more','avia_framework').'<span class="more-link-arrow">  &rarr;</span>');

    #122523

    Hey 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, …)??

    #122524

    Hi ppc1337,

    If you change get_the_content to get_the_excerpt it will return the excerpt field for the post.

    Regards,

    Devin

    #122525

    Hey 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

    #122526

    You can try following code:

    $current_post['content'] 	= $blog_content == "content" ? get_the_content(__('Read more','avia_framework').'<span class="more-link-arrow">  &rarr;</span>') : strip_tags(get_the_content(__('Read more','avia_framework').'<span class="more-link-arrow">  &rarr;</span>'));

    #122527

    Hm … that changed nothing :( Would it be helpfull if you log in to my site and have a look by yourself?

    #122528

    Hey!

    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('&nbsp;'));
    $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"> &rarr;</span></a></div>';
    }

    Best regards,

    Peter

    #122529

    Dude, you are awsome! Works perfectly!

    #122532

    Hey!

    I changed the code a bit to include a read more link.

    Best regards,

    Peter

    #122533

    Now it’s absolutly perfect – thanks a lot!!

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘How to get Excerpt in loop_index.php’ is closed to new replies.