[Plugin: Frontpage-Slideshow] I hacked this to use the featured image
-
I just thought I would let you know that I successfully hacked this plugin to use the wp 3 featured image, as well as displaying the thumbnail in the buttons.
here’s a screenshot:
https://cl.ly/b620c40e58d9703ac75dAlmost everything is done in the template, but i had to modify the core frontpage-slideshow.php just a bit, to get it to add the post_id to the array that it supplies to the frontpageSlideshow_TPL(), as well as changing the default post_thumbnail size to the size of my buttons.
here’s the change to line 81 of frontpage-slideshow.php v 0.9.9.3.4
$fsentries[] = array('title' => $title.'?', 'image' => $image, 'comment' => $comment.'?', 'button-comment' => $buttoncomment.'?', 'link' => $link.' ', 'post_id' => $fspost->ID);
and here’s the new code in the template.php, line 54
$fscontent .= '<li id="fs-entry-'.$id.'" class="fs-entry">'; if(has_post_thumbnail($entry['post_id'])) { $fscontent .= get_the_post_thumbnail($entry['post_id'], 'large', array( 'class' => 'fs-skip fs-img', 'id' => "fs-entry-img-$id" )); $fscontent .= get_the_post_thumbnail($entry['post_id']); } else $fscontent .= '<img id="fs-entry-img-'.$id.'" class="fs-skip fs-img" alt=" " src="'.$entry['image'].'" />'; $fscontent .= '<div id="fs-entry-title-'.$id.'" style="position: relative; top: -44px;" class="fs-title">'.str_replace('?','',$entry['title']).'</div>'; $fscontent .= '<span id="fs-entry-comment-'.$id.'" class="fs-skip">'.$entry['comment'].'</span>'; $fscontent .= '<span id="fs-entry-link-'.$id.'" class="fs-skip">'.$entry['link'].'</span>'; $fscontent .= '</li>';
finally, you have to change the post_thumbnail size to match your buttons in your functions.php file
set_post_thumbnail_size(x, y, true); // Where x is the width of your buttons and y is the height
Cheers, and thanks for the plugin.
- The topic ‘[Plugin: Frontpage-Slideshow] I hacked this to use the featured image’ is closed to new replies.