Viewing 8 replies - 1 through 8 (of 8 total)
  • Subrata Sarkar

    (@subrataemfluence)

    You can customise how excerpt would display by adding a function and by adding a filter in your theme’s functions.php file.

    Try this:

    
    function custom_excerpt_more_link($more){
      return '<a href="' . get_the_permalink() . '" rel="nofollow">&nbsp;[more]</a>';
    }
    
    add_filter('excerpt_more', 'custom_excerpt_more_link');
    

    The above function will remove default Read More link and display [more] instead.

    To control length of your excerpt you need to write another function and add filter for the same:

    
    function set_custom_excerpt_length(){
       return 40;
    }
    add_filter('excerpt_length', 'set_custom_excerpt_length', 10);
    

    excerpt_more and excerpt_length are the filters you have to pick up outputs from your above custom functions.

    Now you can use <?php the_excerpt(); ?> in your page to see them in action.

    Hope this will help!

    Thread Starter mutiarakatabijak

    (@mutiarakatabijak)

    thank u

    Thread Starter mutiarakatabijak

    (@mutiarakatabijak)

    the read more answer didnt work for this theme

    Subrata Sarkar

    (@subrataemfluence)

    But the length did?

    Thread Starter mutiarakatabijak

    (@mutiarakatabijak)

    yes

    Subrata Sarkar

    (@subrataemfluence)

    If length worked right then the other one should also work. There is no reason for this to not work. I hope you added add_filter('excerpt_more', 'custom_excerpt_more_link'); in your functions.php along with the function body.

    AddWeb Solution

    (@addweb-solution-pvt-ltd)

    Hello mutiarakatabijak,

    You can hide ‘Read More’ by css.
    => Put below css code into Custom CSS textarea (Dashboard >> Apperance >> Customize) then click on Save & Publish button.
    => If there is no Additional CSS option then put below css code into your current theme’s style.css file located at wp-content/themes/your_current_active_theme/ folder.


    .blog .entry-content a:last-of-type {
    display:none;
    }

    Note : All Changes you done in style.css or other file are gone when you update theme. So prefer Child Theme

    Hope this will helps you.

    Hey mutiarakatabijak,

    One simple solution that will not require any additional code is to go into the blog post, and open up the “screen options” dropdown at the top of the screen.

    Find the “Excerpt” box, and be sure that it’s ticked. Scroll down the page until you find the “Excerpt” text box, and enter your shorter excerpt there.

    Let me know if that works for you!

    -Kevin

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Limit excerpt and remove read more’ is closed to new replies.