- This topic has 11 replies, 4 voices, and was last updated 2 years, 6 months ago by David.
-
AuthorPosts
-
November 7, 2018 at 10:04 am #721454Björn
Hi.
I am struggling getting the “Read more” button to the bottom.
The max. word count setting does not necessarily lead to a unified height in the post execerpt so the “Read more” buttons do not share the same vertical position. I’d like to position every button – independently from the excerpt word count – 10px from the bottom of the post preview container.
And how do I get rid of the ellipsis? I am using the function to show formatting in the excerpt provided on this page: https://wordpress.stackexchange.com/questions/141125/allow-html-in-excerpt
Thank you in advance!
November 7, 2018 at 4:20 pm #721699TomLead DeveloperLead DeveloperSomething like this should do it:
.generate-columns .inside-article { display: flex; flex-direction: column; } .generate-columns .inside-article .entry-summary { display: flex; flex-direction: column; flex-grow: 1; } .read-more-container { margin-top: auto; }
Depending on browser support needed, you might want to run that code through this tool: https://autoprefixer.github.io/
As for ellipses, try this:
add_filter( 'generate_excerpt_more_output', function( $more ) { if ( ! function_exists( 'generate_blog_get_defaults' ) ) { return $more; } $settings = wp_parse_args( get_option( 'generate_blog_settings', array() ), generate_blog_get_defaults() ); return sprintf( '<p class="read-more-container"><a title="%1$s" class="read-more button" href="%2$s">%3$s%4$s</a></p>', the_title_attribute( 'echo=0' ), esc_url( get_permalink( get_the_ID() ) . apply_filters( 'generate_more_jump','#more-' . get_the_ID() ) ), wp_kses_post( $settings['read_more'] ), '<span class="screen-reader-text">' . get_the_title() . '</span>' ); }, 20 );
November 7, 2018 at 10:21 pm #721812BjörnTom, you are the greatest! Thank you!
November 8, 2018 at 7:10 am #722213TomLead DeveloperLead DeveloperNo problem! 🙂
November 24, 2020 at 5:16 pm #1545291vastPosted as a new question as suggested.
November 24, 2020 at 5:29 pm #1545296ElvinStaffCustomer SupportHi vast,
As this is resolved for the topic starter, can you open up a new topic?
So you could use the Private information text field to provide details if needed(site url, site credentials, etc).
Thank you. 🙂
November 24, 2020 at 5:37 pm #1545305vastThanks Elvin. Posted it as a new question.
November 24, 2020 at 5:46 pm #1545313ElvinStaffCustomer SupportNo problem.
Yeah, I saw & replied to your question.
We’ll make sure to address it there. Thank you.
September 30, 2021 at 11:55 pm #1948936MohammedHello,
Thanks for your theme.
I’v tried the CSS to position the read more button at the bottom, for the category pages, regardless of the excerpt length, but it’s not working.
I would be looking at this myself, I’m just starting out, and haven’t grasped yet all concepts, so i would appreciate your help to speed up the workflow.
Here is the website: https://staging.funeralcircle.com/category/saying-goodbye/obituaries/
I’m sorry for the website topic, i was a bit unfortunate and got this website to work on.
Thanks 🙂
October 1, 2021 at 12:17 am #1948946ElvinStaffCustomer SupportHi Mohammed,
Do you have any PHP snippets related to excerpts? Your site’s blog posts seems to have been filtered and it moved the read more button outside of excerpt container. That’s why Tom’s provided CSS wasn’t working.
The default structure is like this – https://share.getcloudapp.com/RBuL87AE – which Tom’s CSS will work.
Your site’s structure is like this – https://share.getcloudapp.com/qGuJkynl – which is why Tom’s CSS didn’t work.
October 1, 2021 at 2:11 am #1949064MohammedHi Elvin,
Thanks for your support.
I just inquired, and indeed it’s using a snippet.
Initial issue was that it was not possible to have the read more button when i checked the option.
This was not possible apparently with manual excerpt? I found this topic about this in your forum and added that snippet.
https://generatepress.com/forums/topic/read-more-in-case-of-no-excerpt/#post-533006
October 1, 2021 at 5:17 am #1949186DavidStaffCustomer SupportHi there,
with that kind of layout it will be complicated to force the read-more button to the bottom of the container because of the floated left image.
If you can raise a new topic we can look at some other methods.
-
AuthorPosts
- You must be logged in to reply to this topic.