-
AuthorPosts
-
July 17, 2018 at 5:10 pm #986514
For Preview Image Size in Blog Posts setup, there are only 2 options:
– Set size automatically
– Choose size manuallyI don’t want any preview image to display so via CSS I do this:
.home-business .slide-image { display: none; }
where home-business is a Custom CSS Class on a specific Blog Post element. This works and the preview image is not displayed.
The issue is that the image itself is still being loaded on to the page and on the home page there are 5 Blog Posts with multiple posts each so I’m loading a bunch of images on the page for no reason. I’d like to stop the images loading at all.
The best way would be for a new option on Preview Image Size of “Don’t load a preview image”. Can I submit that as a feature request?
In the absence of such an option in the setup, is there a way, I guess via some code filter/segment in functions.php, to stop the preview images being loaded?
July 17, 2018 at 9:18 pm #986637Hey zimbo,
To remove featured images from all post page please try this code in your functions.php
function wordpress_hide_feature_image( $html, $post_id, $post_image_id ) { return is_single() ? '' : $html; } // add the filter add_filter( 'post_thumbnail_html', 'wordpress_hide_feature_image', 10, 3);
Best regards,
Jordan ShannonJuly 19, 2018 at 12:48 pm #987361Hi,
Doesn’t work: tried it on the dev/test site: http://dev.henleyherald.com – various Blog Posts on the home page e.g. under Business, Schools, Sport headings.I disabled file merging and compression, cleared cache.
That aside, I’m guessing your code is attempting to remove all Preview Images site-wide wherever Blog Posts is used. That’s not really what I want – I’d like to be able to target specific instances of Blog Posts on certain pages. For instance this page – http://dev.henleyherald.com/news/ – uses Blog Posts and I’d still want to have the Preview Images display on that. Is this possible?
PS. The best way would be for a new option on Preview Image Size of “Don’t load a preview image” – where can I log a new feature request? I thought there used to be a thread somewhere but can’t find it.
July 19, 2018 at 5:48 pm #987527Hi,
Here is the feature request queue:
So just to be clear, you want to hide images based on categories?
Best regards,
Jordan ShannonJuly 20, 2018 at 1:35 pm #987817The Request Feature button on the Feature Request page does not work. Click it and nothing happens. Tried it in Chrome, Firefox and Edge. Can you look into this?
re. hiding images based on categories: nothing so simple… :-)
I’d like to be able to turn off the Preview Images on any specific instance of Blog Posts on a page.
On the home page I have a heading ‘Business’ and Blog Posts is used to highlight the latest 2 posts of the Business category. I do not want Preview Images, so I set a Custom CSS class on that Blog Posts element of “home-business” and then use “.home-business .slide-image { display: none; }” to turn off the images (but the images are still loaded, which is what I want to stop – and there are 8 Blog Posts elements on the page, only 2 of which I want Preview Images to show on, so I’m loading, but not showing, 12 images I don’t need).
But on the separate Business page I use Blog Posts to display every single post in the Business category, and here I do want the Preview Images to show. So you can’t use categories to turn off Preview Images unless you can target a specific page.
July 23, 2018 at 7:51 pm #988861Hi,
Unfortunately we have not a solution for that right now, that can help you except coding, which would require to hire someone to help you with it.
Best regards,
BasilisJuly 24, 2018 at 1:33 pm #989171OK, but what about the Request Feature button not working?
July 25, 2018 at 1:29 pm #989663Hi zimbo,
Sorry about that, it is not working at the moment. Our devs are working on it.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.