- This topic has 8 replies, 3 voices, and was last updated 9 years, 2 months ago by
Tom.
-
AuthorPosts
-
January 21, 2015 at 10:48 am #67364
Philippe
Hello
I tried to change the style of the tag “read more” following this tutorial :
http://wpbeaches.com/make-read-link-posts-genesis-child-theme/
But it does not work ?
Do you have an idea for me ?
Tks
January 22, 2015 at 12:15 am #67562Tom
Lead DeveloperLead DeveloperGive this CSS a try:
.read-more, .read-more:visited { background: none repeat scroll 0 0 #222; color: #fff; display: table; margin-top: 1.5em; padding: 10px 20px; } .read-more:hover { background:#666; color:#FFF; }Adjust the colors as needed 🙂
January 23, 2015 at 4:10 am #67942Philippe
Fantastic 🙂
Tks so mutch Tom
January 23, 2015 at 5:40 am #67954Philippe
Result :
http://image.noelshack.com/fichiers/2015/04/1422020195-capture-du-2015-01-23-14-25-34.png
You would have an idea to remove the “…” (point 1) ?
And for insert “border-radius:2px;” (point 2) ?
January 23, 2015 at 10:36 am #68078Tom
Lead DeveloperLead Developer1. You’ll have to add a custom function for this – I suggest using this plugin: https://wordpress.org/plugins/code-snippets/
if ( ! function_exists( 'generate_custom_blog_excerpt_more' ) ) : /** * Prints the read more HTML */ add_filter( 'excerpt_more', 'generate_custom_blog_excerpt_more', 100 ); add_filter( 'the_content_more_link', 'generate_custom_blog_excerpt_more', 100 ); function generate_custom_blog_excerpt_more( $more ) { $generate_settings = wp_parse_args( get_option( 'generate_blog_settings', array() ), generate_blog_get_defaults() ); return '<div class="read-more-button"><a class="read-more" href="'. get_permalink( get_the_ID() ) . '">' . $generate_settings['read_more'] . '</a></div>'; } endif;Then your CSS can change to this:
.read-more-button { margin-top: 1.5em; } .read-more, .read-more:visited { background: none repeat scroll 0 0 #222; color: #fff; display: inline-block; padding: 10px 20px; } .read-more:hover { background:#666; color:#FFF; }Hope this helps 🙂
January 20, 2017 at 3:14 am #266119Daniel
Hi Tom,
This is great, but unlike Philippe, I would like to keep the “…”
How do I add that back into the custom functions?January 20, 2017 at 9:53 am #266222Tom
Lead DeveloperLead DeveloperNot sure how it would look to have … before a button?
You can add it before this:
<div class="read-more-button">so it looks like:...<div class="read-more-button">January 20, 2017 at 10:22 am #266239Daniel
Worked a treat Tom. Thanks 🙂
January 20, 2017 at 12:12 pm #266259Tom
Lead DeveloperLead DeveloperYou’re welcome 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.