- This topic has 15 replies, 3 voices, and was last updated 6 years, 7 months ago by Leo.
-
AuthorPosts
-
August 2, 2017 at 10:56 am #358677Sebastián
Hi i would like to fully customize the read more text.
From this: http://i.imgur.com/my9uW8n.png
To something like this: http://i.imgur.com/SyXOSvV.png
You guys know any code which might be useful or plugins which allows me to do that on the blog page?
Thanks
August 2, 2017 at 12:25 pm #358719LeoStaffCustomer SupportHi there,
You can try changing it in the customizer:
https://docs.generatepress.com/article/blog-overview/#blog-contentIf that’s not good enough then try this filter:
https://docs.generatepress.com/article/generate_excerpt_more_output/See Tom’s example here: https://generatepress.com/forums/topic/is-there-a-way-to-change-the-automatic-to-in-gp/#post-314894
As for making it a button style, you can try the CSS here:
https://docs.generatepress.com/article/adding-buttons/And the selector would be
.read-more
A link to your site might be helpful if you get stuck.
August 2, 2017 at 1:08 pm #358750SebastiánI didn’t understand anything.
I installed Code Snippets on my site
And used this:
sprintf( ' ... <a class="read-more" title="%1$s" href="%2$s">%3$s</a>', the_title_attribute( 'echo=0' ), esc_url( get_permalink( get_the_ID() ) ), __( 'Read more', 'generatepress' ) );
But nothing happened.
My site is: https://www.mmarketingonline.com/blog
August 2, 2017 at 1:23 pm #358754LeoStaffCustomer SupportSo basically you want to remove the dots, change the wording and make it a button?
This function should work to remove the dots:
add_filter( 'generate_excerpt_more_output','lh_change_read_more' ); function lh_change_read_more() { return sprintf( ' <a title="%1$s" class="read-more" href="%2$s">Read more</a>', the_title_attribute( 'echo=0' ), esc_url( get_permalink( get_the_ID() ) ) ); }
You can change the working in the customizer: https://docs.generatepress.com/article/blog-overview/#blog-content
Let me know if this works then I’ll give you the CSS.
August 2, 2017 at 4:51 pm #358827SebastiánMy read more text says: Continua Leyendo… (Which means keep reading) So it’s ok.
I don’t really care about the dots.
All i care is the button form the colors the hover and the margins.
August 2, 2017 at 5:44 pm #358832LeoStaffCustomer SupportAre you using any plugins or special code to display that page?
August 2, 2017 at 6:45 pm #358856SebastiánNone.
August 2, 2017 at 6:55 pm #358858LeoStaffCustomer SupportThat’s weird because I’m seeing these classes that are giving CSS styles that are not from GP:
https://s3.postimg.org/6n7mss2ib/toolbox.pngSome kind of tool box?
If you turn off the caching/minifying plugin I might be able to tell where it came from.
August 2, 2017 at 11:46 pm #358920TomLead DeveloperLead DeveloperThis will be a feature in GPP 1.5.
For now, you can do something like this, and just adjust the colors:
a.read-more { display: inline-block; background: red; color: white !important; padding: 15px; border-radius: 10px; }
August 3, 2017 at 6:14 am #359076SebastiánLeo i swear i don’t have any toolbox i guess that line must be from the AddThis Buttons floating on the left. But they don’t block anything.
Tom, thanks. Is there a way to adjust the margins (not only the padding) of the button and the position?
Now: http://i.imgur.com/dO4cO9W.png
What I want: http://i.imgur.com/7J1aaZr.png
Thank you both!
August 3, 2017 at 9:07 am #359157LeoStaffCustomer SupportTry this addtional CSS:
.read-more-container { float: right; padding-right: 10px; padding-top: 10px; } .blog .entry-content p { margin-bottom: 0; }
August 3, 2017 at 9:12 am #359161SebastiánWorked!
And If I want to change the hover colours and adjust the position of the button?
August 3, 2017 at 11:45 am #359288LeoStaffCustomer SupportFor hover:
a:hover.read-more { color: #000000; background-color: #ffffff; }
Edited the code above for the position: https://generatepress.com/forums/topic/customizing-read-more-button/#post-359157
You can adjust the padding px number.
August 3, 2017 at 11:58 am #359306SebastiánPerfect!
Thank you!
August 3, 2017 at 12:04 pm #359308SebastiánOh one last thing i don’t want the buttons to change the text colours when a user clicks on them
-
AuthorPosts
- You must be logged in to reply to this topic.