Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Ajay

    (@ajay)

    This could work in your functions.php or similar place:

    
    add_filter( 'crp_excerpt_more_link_text', '__return_null' );
    
    Thread Starter helgipetersen

    (@helgipetersen)

    Have added:
    add_filter( 'crp_excerpt_more_link_text', '__return_null' );
    To funciton.php but i dont get the read more buttons ?

    Plugin Author Ajay

    (@ajay)

    @helgipetersen

    Where exactly are you adding this? When I use it in my install you get an extra (more…) that is displayed if you have excerpts enabled. It doesn’t display if you have excerpt disabled as the actual thumbnail and titles are already hyperlinked

    Thread Starter helgipetersen

    (@helgipetersen)

    Hi,
    Right know it looks like this:
    https://share.getcloudapp.com/BluDp1eK

    But I need it to be more beautiful. I need a <a href="#">Read more</a> after the posts, not only someone.

    Plugin Author Ajay

    (@ajay)

    @helgipetersen

    You might need to use a custom function. Also remove the above function with the null like I told you previously.

    
    function filter_crp_after_list_item( $after_list_item, $result ) {
    
    	$permalink = get_permalink( $result->ID );
    	$permalink = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $permalink ), __( 'Read more', 'contextual-related-posts' ) );
    
    	$after_list_item = $permalink . $after_list_item;
    
    	return $after_list_item;
    }
    add_filter( 'crp_after_list_item', 'filter_crp_after_list_item', 10, 2 );

    `

    I’ve tested this with my install and it displays well.

    • This reply was modified 3 years, 1 month ago by Ajay.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add “Read more btn”’ is closed to new replies.