thumbnails images not appearing
-
I have used the following code to show my featured image as a thumbnail, however the featured image/thumbnails are only appearing on my homepage side widget ‘other posts’. If I click on a post they do not appear under ‘you may also like’ or on my side widget ‘other posts’. What can I do? This is the code I found and I’ve entered it into my child theme style.css:
.entry-featured {display:none;}
.widget_ci-latest-posts .entry-featured, .entry-related .entry-featured {display: block;}
-
Hi there,
This style rules will hide your featured images. Can you explain what exactly are you trying to achieve?I used the above noted code to prevent my featured image from appearing in the post itself – with the code it no longer does, which is what I wanted. However, I want to be able to see the featured images as thumbnails under ‘you may also like’ and on my side widget ‘other posts’ when I am actually viewing a post itself. The thumbnails/featured images are only showing on my homepage side widget ‘other posts’. I hope that makes sense – my site is currently under construction so I can’t provide you a link and pasting a screen shot for you to see is not working… A sample site I came across that shows what I am referring to is ( i hope this is okay…): http://www.myfavoritehello.com/a-statement-heel/ – the thumbnails appear under ‘recent posts’ and ‘you may also like’ on this post and if you click on her homepage the thumbnails still appear under ‘recent posts’.
Thanks
Please disregard, it does seem to be working now. Thank you!
Glad you worked this out!
I’m sorry… I’m realizing that my image in my post is not appearing on my homepage – just the text is. When I’m on my homepage or when I search for certain posts I am wanting an image to show then an excerpt of my post… I am only seeing the excerpt…is there a way I can fix this? Thanks
Hi there,
do you have featured images in your posts? You can follow this guide on adding featured image.Yes I do have featured images and they are appearing as thumbnails, so that is not an issue. I’m just wanting the picture that I past into my post before the text to appear on the homepage…again similar to the above mentioned sample link. Hope this makes sense
Hi there,
please have a look here https://wordpress.org/support/topic/using-non-featured-images-in-excerpts/Do I need to copy the function.php file into my child theme and them replace any code in there with the noted code from https://wordpress.org/support/topic/excerpts-remove-paragraph-formatting/?replies=2 ? Or can I just paste this full code into my style.css in my child theme?
Hi there,
you will need to create a functions.php (if you dont have) in your child theme and add the suggestion in the above thread there.Let me know if you get stuck somewhere.
Thank you. I created the functions.php folder and added the codes as directed but I see no changes. If you have an email I can email you a screen shot of what my page is looking like since i currently don’t have it live yet?
Just looking at my other codes in style.css and see I have the following code:
.entry-featured {display:none;}
.widget_ci-latest-posts .entry-featured, .entry-related .entry-featured {display: block;}If I changed that to read:
.entry-featured {display:none;}
.widget_ci-latest-posts .entry-featured, .entry-featured {display: block;} would that possibly allow for the picture (NOT the featured image) in my post or video in my post to be displayed in the excerpt along with some text?HI there,
Can you replace in the suggested coderemove_filter('get_the_excerpt', 'wp_trim_excerpt'); add_filter('get_the_excerpt', 'wpse_custom_wp_trim_excerpt');with this
remove_filter('get_the_excerpt', 'wp_trim_excerpt',999); add_filter('get_the_excerpt', 'wpse_custom_wp_trim_excerpt',999);and let me know if this works
Thank you for your support in trouble shooting. Unfortunately that did not work – I will likely be deleting the functions.php folder. Instead I am using the following code in my style.ccs, which is producing the look I am looking for as described above.
.single-post .entry-featured {
display:none;
}
.widget_ci-latest-posts .entry-featured, .entry-related .entry-featured {display: block;}Thank you once again for your ongoing support in addressing my questions.
Hi there,
Can you replacefunction wpse_allowedtags() { // Add custom tags to this string return '<p>'; }with
function wpse_allowedtags() { // Add custom tags to this string return '<p>,<img>'; }in your functions.php suggested code and let me know
I removed the following code from my sytle.css:
.single-post .entry-featured {
display:none;
}
.widget_ci-latest-posts .entry-featured, .entry-related .entry-featured {display: block;}and added your code to function.php
function wpse_allowedtags() {
// Add custom tags to this string
return ‘<p>,‘;
}however now the featured image is showing at the top of my posts, above my post image/content. I will likely remove the function.php file and just stick with the code i have in my style.css.
Thank you
The topic ‘thumbnails images not appearing’ is closed to new replies.
