• Resolved keviinrdgs

    (@keviinrdgs)


    I’am a quite happy oria theme user but recently I’ve stumbled upon a problem.
    I would like to set post excerpts on home page so that it ends with (…).
    Now the excerpts just ends in the middle of a sentence and it doesn’t look good. /
    See: https://humanourbano.com
    I guess a simple modification in the code should solve the problem but I can’t find the right php file and function. Maybe somebody can help?

    This user of theme Oria did that: https://www.mapowicze.pl

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • I did not use Oria before but after installing and activating it looks like by default this theme takes out default […] text from excerpt when rendering. In order to put it back you need to modify the function named oria_excerpt_more in your theme’s functions.php file.

    In Oria’s functions.php file the above function is written as:

    function oria_excerpt_more($more) {
        global $post;
        $read_more = get_theme_mod('read_more_text', 'Continue reading');
    	return '<a class="read-more" href="'. get_permalink($post->ID) . '">' . esc_html($read_more) . '</a>';
    }
    add_filter('excerpt_more', 'oria_excerpt_more');

    Just modify it like this:

    function oria_excerpt_more($more) {
        global $post;
        $read_more = get_theme_mod('read_more_text', 'Continue reading');
    	return '&nbsp;[...]<a class="read-more" href="'. get_permalink($post->ID) . '">' . esc_html($read_more) . '</a>';
    }
    add_filter('excerpt_more', 'oria_excerpt_more');

    i.e. add &nbsp;[...] in between return and <a class...> so that it reads

    return '&nbsp;[...]<a class="read-more" href="'. get_permalink($post->ID) . '">' . esc_html($read_more) . '</a>';

    Hope this will solve your purpose. Let me know if this helped!

    Thread Starter keviinrdgs

    (@keviinrdgs)

    Subrout Sarkar thank you!

    It worked! But I removed brackets to my liking.

    You are welcome!!

    That’s absolutely fine! Glad that I could help ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Home page problem with post excerpt’ is closed to new replies.