• Hi – I’m a WP newbie and am making my first site. So far I think I’ve worked it all out -using the free LEVII theme but there is one thing I can’t seem to figure out. Each post seems to be a fixed length which is quite short (like just one line of text followed by “READ MORE ….”).

    I’d like for posts to be longer – either fixed length but long enough for a video to be visible without having to press READ MORE. I don’t know css but poking around in the options it looks like I may have to add a bit of code to do that but really starting to get out of my depth.

    Any pointers would be very welcome.
    thanks
    Mike

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Hi @effingpot

    Have you tried asking in the theme’s dedicated support forum: https://www.ads-software.com/support/theme/levii

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    See https://developer.www.ads-software.com/reference/functions/the_excerpt/ to find out how to increase the length of the_excerpt.

    You should not modify files in the LEVII theme; create a child theme for template file in question.

    https://codex.www.ads-software.com/Child_Themes

    Thread Starter effingpot

    (@effingpot)

    Jose – thanks didn’t know that was there.
    Steve – I’m afraid reading that is leaving me knowing what I don’t know ??
    I’ll go through it a few times but I’m not sure I understand it :-{
    Rgds
    Mike

    • This reply was modified 7 years, 10 months ago by effingpot.
    Thread Starter effingpot

    (@effingpot)

    Haha – so it looks like you find the post-template.php file and edit it – so far so good!
    From the link you sent it looked like I could change the 55 example to 200 like this – I added the bold stuff. But got an error, so I put it back how it was as I clearly have no clue what I’m doing and could be danger to https://www.friday-fun.com/wordpress where I am building it.

    
    function the_excerpt() {
    	/**
    	 * Filters the displayed post excerpt.
    	 *
    	 * @since 0.71
    	 *
    	 * @see get_the_excerpt()
    	 *
    	 * @param string $post_excerpt The post excerpt.
    	 */
    	<strong>function wpdocs_custom_excerpt_length( $length ) {
        	return 200;</strong>
    	echo apply_filters( 'the_excerpt', get_the_excerpt() );
    }
    
    • This reply was modified 7 years, 10 months ago by effingpot.
    Thread Starter effingpot

    (@effingpot)

    OK making some progress now – I realise I had to add that whole piece of code, which I did and all worked with the 20 per the example. I changed the 20 to 2000 and for text entries I now get more text – but the formatting is lost. (See the ACHTUNG entry).

    For the entries which include a video – like the first one or two, the video is still hidden behind the SEE MORE. I suppose this is only allowing more TEXT when what I am trying to do is not shorten it at all, or shorten by physical length, whatever the content.
    Maybe this excerpt route is the wrong way?
    thanks
    Mike

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    excerpts do not have formatting. If you want the whole post, formatted, use the_content() instead of the_excerpt()

    Thread Starter effingpot

    (@effingpot)

    OK sounds fine – sorry to ask but how do I do that?
    thanks
    Mike

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    In the template file that renders the posts, replace the_excerpt() with the_content().

    Find the right template and copy it to your child theme. Use the plugin “Show Current Template” to help you find the right file(s).

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Making posts longer in LEVII theme’ is closed to new replies.