This thread is over two years old and may be outdated. Please create a new thread if you need help, or email us if you have an active Premium license.

Post Preview only on Main Page

10 years ago · Last reply by Daniel 10 years ago

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.

Need fast email support? Get SiteOrigin Premium

Replies

9
  1. Magus Staff 10 years, 10 months ago

    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. nina 10 years, 10 months ago

    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. nina 10 years, 10 months ago

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

  4. Magus Staff 10 years, 10 months ago

    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. nina 10 years, 10 months ago

    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. nina 10 years, 10 months ago

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

  7. Magus Staff 10 years, 10 months ago

    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. nina 10 years, 10 months ago

    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. Daniel Staff 10 years, 10 months ago

    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.

Have a different question or issue?

Start New Thread