Change Read more text on posts

Hello Guys,

So i am a bit confused.
tried to read up on it, and seems like people is changing the themed css ?
But seems like to be old posts. and when you guys link to some guides to this, they have been deleted.
So seems like i have changed color of the links.
But WHERE to change the read more text ?

Confused if i should go change the code somewhere, or if you have made a feature in theme for this. :slight_smile:

Sorry if i am an idiot and you have already explained this a million times recently.

If confused, it is the read more found here i am talking about ( from new posts )
http://test.vbentzen.dk/brugerservice/drift/

Hey Aske,

Read More is the standard text for blogs so our theme does not have an option to change it. But, WordPress has an official instruction to change the text. See Modify the Read More text when using the the_excerpt() at https://codex.wordpress.org/Customizing_the_Read_More

I just tried the code suggested in there and it works. The only thing that needs changing in the code is the priority which is number 11 in the code below:

// Replaces the excerpt "Read More" text by a link
function new_excerpt_more($more) {
       global $post;
	return '<a class="moretag" href="'. get_permalink($post->ID) . '"> Read the full article...</a>';
}
add_filter('excerpt_more', 'new_excerpt_more', 11);

Hope that helps.

Great, Thanks.

This fixed atleast the first portion of my thing :slight_smile:
Problem with this is that it overrides all of the css.
i still want it it on a new line and BOLD as existing. Is there are we for me to fix this aswell ?
So we keep the CSS applied, but just change text ( i assume by doing this code, it jst grabs my normal link css. )

And i am not sure i understand this part “I just tried the code suggested in there and it works. The only thing that needs changing in the code is the priority which is number 11 in the code below:”

What exactly is this number 11 doing in this filter line?

It seems to be working fine when i just copied the code in , and then i just changed the “read the full article” to my desired thing.

Number 11 is the priority in WordPress hooks. Regretfully, I can’t really explain that as part of our product support as that goes inside the realm of general WordPress development.

If the code in WordPress works fine for you without changing the priority, please go for it. What I suggested is only a guide and should not be treated as a one size fits all solution because in WordPress, other things like third party plugins could also have an effect in theme features.

Sorry if it affected your CSS, It’s because the code changed the class also.

Change the class to more-link and add this code in Theme Options > CSS.

.more-link {
    display: block;
    font-weight: bold;
}

Thanks.

FANTASTIC :slight_smile:

all fixed now !
Seems like it isnt needed with the priority.
But i know what to look for if something shows up odd :slight_smile:
Again. Thank you.

Have a great evening.

You’re welcome!
We’re glad @Christian_y were able to help you out.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.