- This topic has 31 replies, 3 voices, and was last updated 3 years, 9 months ago by Mouse.
-
AuthorPosts
-
May 29, 2020 at 6:27 am #1306272DavidStaffCustomer Support
How did you add the first PHP code? And is still added to the site?
May 29, 2020 at 6:32 am #1306278MousePHP code in the functions.php
and the CSS code in the additional CSS in the customizer.May 29, 2020 at 9:57 am #1306722DavidStaffCustomer Supportdo you have any other custom functions added to the site ?
May 29, 2020 at 3:21 pm #1307039Mouseno its just functions.php that I can see.
May 30, 2020 at 4:12 am #1307464DavidStaffCustomer SupportCan you try adding the function to the Code Snippets plugin.
May 31, 2020 at 3:32 am #1308457MouseHi there, I am not understanding. Can you log in to the website and have a look?
May 31, 2020 at 6:39 am #1308595DavidStaffCustomer SupportThis document explains adding PHP:
https://docs.generatepress.com/article/adding-php/
Towards the end it provides a link to the Code Snippets plugin.
If you can test the code using the Code Snippets plugin we can determine whether there is an issue with the function or an issue within the functions.phpMay 31, 2020 at 12:36 pm #1309071MouseHi there… I already did that too, but it’s not working.
Please have a look at this link.
https://ibb.co/1bsXYcL
Here you can see I numbered 3 points. 1,2 and 3.In 1 : In one the image is a link.
In 2 : the text is also a link which does not show completely.
In 3 : The text ends with the use of (…)
I want to make a single clickable box. So they dont link to the post seperately (which is not good for SEO). Also want the title to show fully.
And in the 3rd I want (…) to show or else it seems awkward.
What you suggested is not working. Please help me. It’s been over a week now and it’s very frustrating and ruining the user experience. If you can just log in the website and fix it. I will be very greatful to you. Thanks.
May 31, 2020 at 7:32 pm #1309295TomLead DeveloperLead DeveloperHi there,
We aren’t able to log in and fix this for users – sorry about that.
The posts you screenshotted are not using WP Show Posts, which is why the code is not working.
To remove links from GeneratePress featured images, you can do this:
add_filter( 'generate_featured_image_output', function() { return sprintf( '<div class="post-image"> %2$s %1$s </div>', get_the_post_thumbnail( get_the_ID(), apply_filters( 'generate_page_header_default_size', 'full' ), array( 'itemprop' => 'image', ) ), apply_filters( 'generate_inside_featured_image_output', '' ) ); } );
To link the entire container, you can do this:
.generate-columns .inside-article { position: relative; } .generate-columns a:before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
June 1, 2020 at 11:45 pm #1310669MouseHi… Again.. where do I place these codes?
Also How to I make the title show completely in the container?June 2, 2020 at 4:09 am #1310944DavidStaffCustomer SupportThe code starting with
add_filter
is PHP:https://docs.generatepress.com/article/adding-php/
The other code is CSS:
June 3, 2020 at 3:54 pm #1313300MouseHi worked like a charm. Thanks.
Now Just need the titles to show fully. Right now the post titles do not show fully. Please help with that as well.
June 4, 2020 at 2:57 am #1313775DavidStaffCustomer SupportThe Dispatch Site uses some CSS to trim the titles to 2 lines.
Go to Customizer > Additional CSS and delete this:.generate-columns-container article .entry-header .entry-title, .wp-show-posts article .wp-show-posts-entry-title { line-height: 2.5ex; height: 5ex; overflow: hidden; text-overflow: ellipsis; }
June 4, 2020 at 8:57 am #1314432MouseHi thanks again that worked perfectly.
And also I am sorry to bug you so much. But I also want to make this image sticky in my sidebar. Can you also let me know what should I do to do that?
June 4, 2020 at 9:37 am #1314495LeoStaffCustomer SupportCan you open a new topic for the new question?
Thanks 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.