Home>Support>Post Preview only on Main Page

Post Preview only on Main Page

By nina, 10 years ago. Last reply by Daniel, 10 years ago.
Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

Hi there,

is there a possibility to show an excerpt on the main page and on another page (where all posts are collected e.g. News) the hole posts without a link to one single post?

And is there a way to define how long the excerpt is?

Please help me i have no idea what else i should try..

Thanks!

URL: http://sport-inmotion.com/Wordpress/

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 10 years, 2 months ago Magus
    Hi, I Work Here

    Hi Nina

    You can define the length of the excerpt by adding some code to you child theme functions file. If you are not already running a child theme here are the instructions.

    https://codex.wordpress.org/Child_Themes

    Here is a link to a bare child theme for Vantage for you to use.

    https://siteorigin.com/wp-content/uploads/2015/01/vantage-child-vanilla-enqueue.zip

    Please be aware that when you change to a child-theme you will lose some alterations you have already made.

    You can edit the functions.php by going to Appearance->Editor once you have made the child-theme your active theme.

    Add this to the functions directly below the enqueue statements

    function new_excerpt_length($length) {
        return 200;
    }
    add_filter('excerpt_length', 'new_excerpt_length');
    

    Change the return value to however many characters you want the excerpt to contain.

    Hope this helps

    Magus

  2. 10 years, 2 months ago nina

    Thanks a lot for your help! :)
    This has solve my problem with the lenght of the excerpt.

    – but there is still the problem, that now all posts are shown as an excerpt (also on the archive page)
    -> here is hopefully a better explanation of what i want to do:
    the post (excerpts) on the main page should be shown – and link to a page news where all posts are listet in full lenght without any link to single posts…

    Can you please help me :) THANKS

  3. 10 years, 2 months ago nina

    and the style of the post has gone with the php function..

  4. 10 years, 2 months ago Magus
    Hi, I Work Here

    Hi Nina

    You are correct the function overrides the default excerpt length, but this is all it does. Part of your questions was if there was a way to define how long an excerpt was, that is the only way.

    If you want to show the original excerpts on the home page and the full post on the blogs page then you will need to either remove that function or change the length you have set to one which is more pleasing to the eye.

    Then go to Appearance->Theme Settings->Blog and set the option Post Content to ‘Full Post’.

    This should give you the appearance you require.

    Let us know how you get on

    Magus

  5. 10 years, 2 months ago nina

    Yea i do understand what the php function does and that also was what i wanted to do. So really thanks for that.

    But i only see either the full posts on both pages or the expert on both pages. it isn’t working that there are two different styles for posts.

    thanks for your help

  6. 10 years, 2 months ago nina

    and by the way.. with the style has gone, i mean that the header has no color ,.. or so any more

  7. 10 years, 2 months ago Magus
    Hi, I Work Here

    Hi Nina

    I am seeing the correct styling and colour for your header as set in Appearance->Customize.

    To get an excerpt on the home page please change the excerpt length in the function from 200 to 56.

    To show the full post on your news page go to Appearance->Theme Settings->Blog and set the option Post Content to ‘Full Post’.

    Hope this helps

    Magus

  8. 10 years, 2 months ago nina

    No, this is not working. Have no idea why not. but thanks for trying to help me :)

    But i found a widget, so that solved my problem.

  9. 10 years, 2 months ago Daniel
    Hi, I Work Here

    Hi Nina

    Am glad that you have managed to iron out your issue.

    Always feel free to open a new thread whenever you require support

    @Magus much appreciated

    Cheers

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More