Community Forums › Forums › Archived Forums › Design Tips and Tricks › Problem with changing default [Read more] button.
Tagged: code missing, Metro theme., read more button
- This topic has 6 replies, 2 voices, and was last updated 8 years, 11 months ago by
abssquad.
-
AuthorPosts
-
April 14, 2014 at 1:59 pm #100268
abssquad
MemberHey,
I have trouble finding the code, that is giving me the default Read more button, when making text brake in my blog.
I want to customize my default [Read More] button to a simple blue link, without brackets.
Im using Metro pro theme running on genesis. Looked everywhere but I didn't managed to find the specific code.
Anyone has ideas, what shall I do?
http://abssquad.comApril 14, 2014 at 5:49 pm #100314nutsandbolts
MemberTry adding this to functions.php (customize the last line with whatever you'd like your "read more" link to say):
// Customize Read More text add_filter( 'excerpt_more', 'nabm_more_link' ); add_filter( 'get_the_content_more_link', 'nabm_more_link' ); add_filter( 'the_content_more_link', 'nabm_more_link' ); function nabm_more_link() { return '<a href="' . get_permalink() . '" rel="nofollow">Continue Reading...</a>'; }
You could also give it a div class to make it easier to style.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+April 15, 2014 at 2:53 am #100364abssquad
MemberAwesome job Andrea!! Thanks a lot.
There is still this one thing I was wondering about, that how can I change the colour of the continue reading link, right now it is black but I would like a certain blue tone for it, and is it possible to remove the line under it as well?
April 15, 2014 at 10:38 am #100502nutsandbolts
MemberI usually give my link a div class, like this:
// Customize Read More text add_filter( 'excerpt_more', 'nabm_more_link' ); add_filter( 'get_the_content_more_link', 'nabm_more_link' ); add_filter( 'the_content_more_link', 'nabm_more_link' ); function nabm_more_link() { return '<a href="' . get_permalink() . '" rel="nofollow"><div class="morelink"Continue Reading...</div></a>'; }
That way in my stylesheet I can do things like this:
.morelink { color: blue; text-decoration: none; } .morelink:hover { color: #000; }
Or whatever styling works best for your situation. Hopefully that makes sense.
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+April 15, 2014 at 12:46 pm #100553abssquad
MemberIm afraid there is a mistake in the last code, because the continue reading link will dissapear when I change the first code to second you gave me.
Since Im not very familiar with css I cant figure out what is the problem there.
Sorry for the trouble, hope you can help me with that.
April 19, 2014 at 8:50 am #101274nutsandbolts
MemberSorry about that - you're correct, there's an error there. Try this one:
// Customize Read More text add_filter( 'excerpt_more', 'nabm_more_link' ); add_filter( 'get_the_content_more_link', 'nabm_more_link' ); add_filter( 'the_content_more_link', 'nabm_more_link' ); function nabm_more_link() { return '<div class="morelink"><a href="' . get_permalink() . '" rel="nofollow">Continue Reading...</a></div>'; }
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+April 22, 2014 at 3:27 am #101819abssquad
MemberThanks a lot Andrea, that solved the problem.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.