Problem with child pages' thumbnails
-
There is a bug which makes the child pages’ thumbnails show incorrecty: the don’t show their own thumbnail but its parent’s.
I’ve patched the code in order to try to:
– If it has thumbnails, show its own thumbnail
– If not, but the parent has a thumbnail, show the parent’s thumbnail (this behaviour should be able to be configured)
– Else, it does not show any image
Here is the modified part of the loop-children.php:
<?php /* The post thumbnail */
if (!has_post_thumbnail($page->ID)) {
if (has_post_thumbnail()) {
echo '<div class="excerpt-thumb">';
the_post_thumbnail(apply_filters('graphene_excerpt_thumbnail_size', 'thumbnail'));
echo '</div>';
}
} else {
echo graphene_get_post_image($page->ID, apply_filters('graphene_excerpt_thumbnail_size', 'thumbnail'), 'excerpt');
}
?>Here is the corresponding diff for the file:
58,61c58,63
< if (has_post_thumbnail(get_the_id())) {
< echo '<div class="excerpt-thumb">';
< the_post_thumbnail(apply_filters('graphene_excerpt_thumbnail_size', 'thumbnail'));
< echo '</div>';
---
> if (!has_post_thumbnail($page->ID)) {
> if (has_post_thumbnail()) {
> echo '<div class="excerpt-thumb">';
> the_post_thumbnail(apply_filters('graphene_excerpt_thumbnail_size', 'thumbnail'));
> echo '</div>';
> }
63c65
< echo graphene_get_post_image(get_the_id(), apply_filters('graphene_excerpt_thumbnail_size', 'thumbnail'), 'excerpt');
---
> echo graphene_get_post_image($page->ID, apply_filters('graphene_excerpt_thumbnail_size', 'thumbnail'), 'excerpt');Hope it helps!
NeoEGM.
Hi
Nice one 🙂
Then again I like to know, are You talking Graphene 1.3b:
http://graphene.googlecode.com/svn/trunk/graphene/changelog.txt
Kim
Admin
Hi NeoEGM,
Yes, this is a known issue and has been fixed in the upcoming version 1.3. Hopefully, if everything goes right, it should be available to the public in the next few days.
Thanks!
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.