Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $featurePosts = new WP_Query('showposts=3&cat=1711');
- if ($featurePosts->have_posts()) {
- $strString = "<div class='featured'>";
- while ($featurePosts->have_posts()) : $featurePosts->the_post() ;
- $strString .= "<div class='featured-post'>";
- if ( has_post_thumbnail() ) {
- $imgattr = array(
- 'class' => "attachment-thumbnail",
- 'alt' => trim(strip_tags( get_the_title() )),
- 'title' => trim(strip_tags( get_the_title() )),
- );
- $strString .= '<a href="'. get_permalink().'" title="'. get_the_title() .'">' . get_the_post_thumbnail(get_the_ID(),'feature-thumb') . '</a>';
- }
- $strString .= '<p><a href="'. get_permalink().'" title="'. get_the_title() .'">'.get_the_title().'</a></p>';
- $strString .= "</div>";
- endwhile;
- $strString .= "</div>";
- }
- return $strString;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement