', ']]>', $text); $text = strip_tags($text); $words = explode(' ', $text, $posts_settings['ex_length'] + 1); if (count($words) > $posts_settings['ex_length']) { array_pop($words); $text = implode(' ', $words); } } return $text . '...'; } // Display on page. function featuredposts() { global $post, $wpdb, $posts_settings; $post = new WP_Query('p='.$posts_settings['posts_id'].''); $post->the_post(); if ($posts_settings['i_display'] == 'yes') { $headerimages =& get_children('post_type=attachment&post_mime_type=image&post_parent=' . $posts_settings['posts_id']); if ($headerimages) { $thumb_w = get_option('thumbnail_size_w'); $thumb_h = get_option('thumbnail_size_h'); if ($thumb_w < $posts_settings['i_width'] || $thumb_h < $posts_settings['i_height']) { $image_url = wp_get_attachment_image_src(array_shift(array_keys($headerimages)), $size='full'); $image_url = $image_url[0]; } else { $image_url = wp_get_attachment_image_src(array_shift(array_keys($headerimages)), $size='thumbnail'); $image_url = $image_url[0]; } echo '
Your settings have been saved.
This plugin makes it easy to add featured posts to your site.
If you like this plugin, please consider linking to impNERD.com