Community Forums › Forums › Archived Forums › Design Tips and Tricks › Featured image problem
- This topic has 11 replies, 5 voices, and was last updated 10 years, 12 months ago by Zell.
-
AuthorPosts
-
April 21, 2013 at 7:36 am #36685ZellMember
Hi there,
I'm having problems with the featured image function in Genesis and I'm working on creating a new child theme by modifying the function files.
Here's what I want to achieve:
1) Display the featured thumbnail (150x150) on the blog page
2) Ensure that tags are not stripped on the blog page.
3) Display the full featured thumbnail on the post page (full size)Heres what I'm currently doing to avoid the problem
I've tried setting up Featured Image in Admin > Genesis > Theme Settings > Content Archives to allow featured images. However, this setting does not allow me to have a full width image on my post.
Also, if I set to allow featured images and I place an full width image on the top of my post before the <!-- more --> tag, I have to set content limit to 1000 characters to prevent two pictures from showing up on my blog page. And this settings results in stripped tags.
Can I get any help here? Thanks!
Here's my website for reference: http://www.zell-weekeat.com
http://www.zell-weekeat.comApril 22, 2013 at 1:41 am #36825ZellMemberHelp anyone?
Thanks!
April 23, 2013 at 7:40 am #37096weslindaMemberA few questions for you.
- Is the thumbnail a cut of the larger featured image? Basically, you are using the same image for the thumbnail and the featured image on the post?
- When you share that you are displaying the full featured thumbnail on the post page, are you doing this by inserting it into the post or calling it as a featured image? So it's added automatically?
Also, you mention needing to limit to 1000 characters because of stripping formatting. It might be easier to use Excerpt for the blog archive, as that will allow you to set specific content to show on that page for each post, with no concern of image conflicts.
Loving the Genesis Life!
April 23, 2013 at 7:42 am #37097vajrasarMemberHave you tried registering the image size of 150X150 first in the functions.php and then setting that size in your Admin > Genesis > Theme Settings > Content Archive to get the result.
You may use this -
`add_image_size( 'custom-home', 150, 150, TRUE );`
reference -
I make WordPress websites using Genesis Framework.
April 23, 2013 at 7:54 am #37103vajrasarMemberOk, referring to my above comment, I forgot that the 150 by 150 size is pre-defined with the name thumbnail in the settings. I would suggest you the steps pointed by @weslinda, as if you want the same image to show up on single and blog page then you may not need featured image option to be used.
Else, you can simply upload any image (150 by 150 in your case) in featured image section of post, when you do not want to show the main image of the post but some different image.
I make WordPress websites using Genesis Framework.
April 23, 2013 at 8:13 am #37125surefirewebservMemberHere you go, straight from my blog. This snippet will fix your duplicate image issues...
add_filter('the_content','wpi_image_content_filter',11); function wpi_image_content_filter($content){ if (is_home() || is_front_page()){ $content = preg_replace("/<img[^>]+\>/i", "", $content); } return $content; }
You can change the conditionals to anything you want. Currently they're targeting the homepage.
SureFireWebServices.com | Genesis Tuts and More
Genesis Theme Starter Kit | It’s FreeApril 23, 2013 at 9:03 am #37149ZellMemberHey everyone, thanks for chipping in to help me with this problem.
- Is the thumbnail a cut of the larger featured image? Basically, you are using the same image for the thumbnail and the featured image on the post?
- When you share that you are displaying the full featured thumbnail on the post page, are you doing this by inserting it into the post or calling it as a featured image? So it’s added automatically?
1) Yes basically the thumbnail is a miniature sized version of the large image that I intend to put as the main image of the blog post.
2) I'm calling inserting it manually at the moment. Ideally, I'm looking for a solution to set a featured image that automatically insert the full sized image at the top of my post, and a thumbnail version at the blog template page.Limiting the content to 1000 characters resulted in stripped formatting, but when I used blog excerpts instead, the "Read More" link doesn't appear. Instead, its replaced by 3 ellipses that doesn't link to anything.
So in summary, I would ideally want it to
1) Show featured image (full) on post
2) Show featured thumbnail (150 x 150) on blog template (the images are from the same image and just included once with featured image)
3) Ensure there is no stripped tag
@vajrasar:
I'm currently using the featured image checkbox under Admin > Genesis > Theme Settings > Content Archives and I've set it to 150x150.
@surefirewebserv:
Thanks for the snippet! I'm not too sure I understand how to use it though. Can I get a quick explanation on this snippet and how should I use it?Also, does anyone want me to put up my functions.php file?
Thanks all!
Zell
April 23, 2013 at 11:40 am #37195jiversenMemberThis link may help you for the "..." issue when using an excerpt :http://codex.wordpress.org/Function_Reference/the_excerpt
Here is the snippet you probably want:
For versions 2.9 and higher of WordPress
By default, excerpt more string at the end is set to '[...]'. To change excerpt more string using excerpt_more filter, add the following code to functions.php file in your theme:function new_excerpt_more( $more ) { return '[.....]'; } add_filter('excerpt_more', 'new_excerpt_more');
April 23, 2013 at 8:31 pm #37304ZellMemberThanks for chipping in. I've tried that option as well, and its not what I was looking for.
I'm looking to manually insert the "read more" link in the post itself, and I don't want to limit the post excerpt a certain amount of characters. The except_more filter doesn't allow me to do so.
Guys I really appreciate the help here!
April 26, 2013 at 8:22 am #37841ZellMemberHi there, I've tested with using excerpt.
The problem with using excerpt is that I wont be able to put the "Read more" tag right where i want the text to break. If i modify the excerpt length to say, 800, I don't even get to see the "Read more" link.
Some help please?
April 29, 2013 at 12:08 pm #38444weslindaMemberThat's the function that excerpt brings to the table, so there aren't a ton of "read more" links. If you feel you want those, you could do a simple custom bit of code to add the "read more" link if you wanted. Probably the easiest way to solve this.
Loving the Genesis Life!
April 29, 2013 at 8:24 pm #38493ZellMember@ weslinda
How would such a custom bit of code look like? Do I hook it on to "genesis_after_post_content"?
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.