Make "more" buttom for posts

hi
i think there is a limit on character to show the posts like this
[...]
i wana determined number of characters myself
and show more with button
more button
please help me
tnx

Hello there,

To replace the […] with a read more button, please add the following function into your child theme’s functions.php file.


function moesia_child_elipsis_link($content) {
	return str_replace('[&hellip;]', '<a class="welcome-button readmore-button" href="'. esc_attr(get_permalink()) .'">Read more</a>', $content);
}
add_filter('the_excerpt', 'moesia_child_elipsis_link');

Or you can use functionality plugin like Code Snippets if you don’t have a child theme.

To style the button, you can add style rules with this selector:


.welcome-button.readmore-button{
  /* CSS declarations go here */
}

Regards,
Kharis

tnx a lot khairs
ii dont have child theme
and when i add this code in snip this error has been shown
error
this error shown in abstract area
and
excuse me where should i add this code line?

.welcome-button.readmore-button{
  /* CSS declarations go here */
}

im so biginner and ex me for this questions
special tnx

No one to help me
i’m in trouble

Hello there,

I would like to apologize in advance for the delay.

Where did you add that code?

Please replace it with this one:


function moesia_child_elipsis_link($content) {
	return str_replace('[&hellip;]', '<a class="welcome-button readmore-button" href="'. esc_attr(get_permalink()) .'">Read more</a>', $content);
}
add_filter('the_excerpt', 'moesia_child_elipsis_link');

> excuse me where should i add this code line?

You can use the Simple Custom CSS plugin to add custom CSS code.

Regards,
Kharis