//Doesn't work with updated wp and php
add_action('widgets_init', create_function('', 'return register_widget("Featured_Post_Widget");') , 100);
//replace with this line
add_action('widgets_init', function(){ return register_widget("Featured_Post_Widget"); }, 100);
]]>
I’m trying to get some posts and adjust the appearance of it according to the template I have built
]]>Is there any chance of some screenshots to show what this looks like in use? I’ve added the code, but nothing happens when I view the posts page on the frontend. Is there supposed to be some indication that the posts are featured?
]]>I’m trying to edit my blog page so that I can get the featured posts up top in their own separate section and then below that have the rest of my blog posts appear.
I added the code to the template and the featured post appeared, but the rest are gone. depending on where I add the wp_reset_query();
I can make only one set of posts appear at a time. I’d like to have both on the page if possible.
This plugin is awesome, but how can i customize the output?
how to rewrite the output, for example, print the category, content of the post?
If I deploy the plugin while I have WP_Debug set to true: admin screens are plastered with this notice:
Notice: The called constructor method for WP_Widget is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in /var/www/piratesbreakdown/wp-includes/functions.php on line 3457
This isn’t critical: it’s just a notice and won’t effect production hosts. Still, it’s a bit annoying.
Thank you.
]]>With the new release today comes new deprecation notice.
Notice: The called constructor method for WP_Widget is deprecated since __construct()
]]>Hello,
I did the latest WordPress 4.2.2 upgrade last week.
I just spotted that my featured page not showing up.
Here is my code.
function show_featured_posts() {
global $post;
$arg = array(‘featured’=>’yes’,’post_status’=>publish,’post_type’=> array( ‘post’, ‘page’));
//get $numbers of featured posts
$featured_posts_array = get_posts( $arg);
$output .= ‘<div class=”slider-wrapper theme-default”>’;
$output .= ‘<div id=”slider” class=”nivoSlider”>’;
foreach ($featured_posts_array as $post) : setup_postdata($post);
$nivo_title = “#nivo”.get_the_ID(); //assign the postID as title of the image
if ( function_exists(“has_post_thumbnail”) && has_post_thumbnail() ) {
$output .= get_the_post_thumbnail(get_the_ID(), array(580,248), array( “class” => “post_thumbnail”, ‘title’ => $nivo_title )); }
$caption .= “<div id=’nivo”.get_the_ID().”‘ class=’nivo-html-caption’>
<h5>“.get_the_title().”</h5>
</div>”;
endforeach;
$output .= ‘</div>’;
$output .= $caption;
$output .= ‘</div>’;
return $output;
//reset WP query
wp_reset_query();
}
Do you have any suggestions?
Thank you
Ton
]]>I use this construction for get two featured posts.
<?php query_posts($query_string."&featured=yes&posts_per_page=2");
But I need to get two random posts from all of my featured posts.
How can I do it?
Hi. I have this code into my template:
`<?php $args_super = array(‘posts_per_page’ => -1, ‘post_type’ => ‘any’, ‘featured’ => ‘yes’); ?>
<?php $my_query_super = new WP_Query($args_super); ?>
<?php if ($my_query_super->have_posts()) : while ($my_query_super->have_posts()) : $my_query_super->the_post(); ?>
<!– POST FORMAT –>
<?php endwhile; wp_reset_postdata(); ?>
<?php endif; wp_reset_query(); ?>
I checked and unchecked some post to try funcionality. I checke 3 post and 2 custom posts (1 custom post type = news and 1 custom post type = projects). But, instead of 5 featured posts, I’m getting 8 featured posts. I take a look at the database and I noticed that the query also includes posts with meta value = no. I try runing post type array in the WP query and also meta query array but I’m not obtaining the right results. The query isn’t retrieving only the 5 featured posts.
Do I’m doing something wrong?
ps: sorry for my bad english.
]]>For several days now I’ve been trying to figure out how to get images and posts to show up in the Featured Posts carousel on my home page. I have looked at YouTube videos and searched all over my site, but I can’t find any information on how to do it. Somebody PLEASE help! I have a NewsStation Theme…
]]>Love the plugin! Thanks.
Just wanted to know if there was a way to NOT show the featured posts.
I am using &featured=yes
to show posts at the top of the page, then underneather I am creating a new loop to show the reset, but the featured posts are also being shown here, I would like them to not be repeated. I tried &featured=no
but this didnt work.
Any tip on how I can do this?
]]>Hello,I want to add a function on function.php to change permittion edit custom post type also see star, Thank’s
I see this on plugin
function manage_posts_columns($columns) {
global $current_user;
get_currentuserinfo();
if (current_user_can(‘edit_posts’, $user_id)) {
$columns[‘featured’] = __(‘Featured’);
}
return $columns;
}
how to change this on function.php
I’m using the Featured Post plugin. The post on my home page is duplicating on my Blog page. It should only appear once.
https://lisakotin.com
https://lisakotin.com/blog/
Please help.
Tina
]]>Huge, huge bug after updating.
After updating the plugin to the current version 3.2.1, all the post that were marked as featured were no longer featured. they all lost the star that marked as featured and also they were not display in the theme. However, when I downgrade to the previous version I had 2.0.1 everything went back to normal.
Plugin is not working in WP less than 3.8. May be this is because you have used `dashicon’ which was introduced only after 3.8. This information needs to be clearly mentioned in the description of plugin. Any way, nice plugin.
]]>Notice: Undefined index: post_status in /Users/lukerollans/www/site/wp-content/plugins/featured-post/featured-post.php on line 190
Line 190 of featured-post.php should be changed to
if (is_admin() && isset( $_GET['post_status'] ) && $_GET['post_status'] == 'featured') {
Screws up AJAX requests etc.
Is this plugin on GitHub? Happy to submit a pull request
]]>Hi and thanks for the great Plugin.
I have added the query_posts function before the main loop and it does work when the page is set as Front Page in WP Reading Settings.
However the query returns blank if the page is not Front Page, such as “/?page_id=11”.
Is this a bug or do you suggest any way to trace back the error?
Thanks a lot!
]]>How can i get the value of featured post inside the loop?
I need that for showing an image near featured post.
query_posts(‘post_type=work&posts_per_page=-1’);
if (have_posts()) : while (have_posts()) : the_post();
$is_featured = get_post_meta( $post->ID, ‘_is_featured’ ,true);
// ?? this return a empty first vaule / array
what’s wrong?
If you turn on WP_DEBUG you’ll notice many “Undefined index: post_status..” errors in lines where you reference “$_GET[‘post_status’]” since this isn’t always set then PHP complains.
You should check if the key exists before trying to use it.
]]>I believe get_next_posts_link & get_previous_posts_link no longer works on pages using this plugin. Those functions will still grab all posts featured or not… so you’ll end up with an erroneous ‘view older posts’ link where there are no more posts.
]]>as in the title
]]>Hi,
I was wondering, how to display featured post only in specific post or custom post ?
Do you guys know what to do?
Thanks in advance
I want to display my featured posts with a layout. Below is a patch that lets you drop a sovit-featured-post.php file in your theme where you can loop through the posts and render however you want.
Change
function widget( $args, $instance )
{
extract( $args );
$title = apply_filters( 'widget_title', $instance[ 'title' ] );
to
function widget( $args, $instance )
{
extract( $args );
$title = apply_filters( 'widget_title', $instance[ 'title' ] );
// Display custom widget frontend
if ( $located = locate_template( 'sovit-featured-post.php' ) ) {
require $located;
return;
}
Example Usage
Drop sovit-featured-post.php into your theme and add the following:
<?php
query_posts( 'post_type=' . $instance[ 'post_type' ] . '&showposts=' . $instance[ 'num' ] . '&featured=yes' );
// Don't show this widget if we have no featured posts
if ( !have_posts() )
return;
echo $before_widget;
if ( $title )
echo $before_title . $title . $after_title;
echo '<ul>';
while ( have_posts() ):
the_post();
echo '<li>';
the_post_thumbnail();
echo '</li>';
endwhile;
echo '</ul>';
echo $after_widget;
The above is a very simple example of showing a list of featured images using your plugin. If no featured images are found, it won’t display the widget at all.
]]>In WP 3.6.1 with WP_DEBUG turned on your plugin throws various warnings. Here are the fixes.
Undefined index: post_status in /path/to/wp-content/plugins/featured-post/featured-post.php on line 157
change
if ( is_admin() && $_GET[ 'post_status' ] == 'featured' ) {
to
if ( is_admin() && isset($_GET[ 'post_status' ]) && $_GET[ 'post_status' ] == 'featured' ) {
Next
Undefined index: post_status in /path/to/wp-content/plugins/featured-post/featured-post.php on line 74
Change
$class = $_GET[ 'post_status' ] == 'featured' ? "current" : '';
to
$class = isset($_GET[ 'post_status' ]) && $_GET[ 'post_status' ] == 'featured' ? "current" : '';
Next
Notice: Undefined index: title in /path/to/wp-content/plugins/featured-post/featured-post.php on line 201-203
Change
function form( $instance )
{
global $SovitFeaturedPost;
$title = esc_attr( $instance[ 'title' ] );
$type = esc_attr( $instance[ 'post_type' ] );
$num = (int) esc_attr( $instance[ 'num' ] );
$post_types = get_post_types( array(
'publicly_queryable' => true
), 'objects' );
to
function get_default_post_type( $post_types )
{
global $SovitFeaturedPost;
// Grab a default post type
$default = '';
foreach ( $post_types as $key => $post_type )
{
if ( !in_array( $key, $SovitFeaturedPost->ignore_post_type ) )
{
$default = $key;
break;
}
}
// None found - assume 'post'
if ( empty($default) )
$default = 'post';
return $default;
}
function form( $instance )
{
$post_types = get_post_types( array(
'publicly_queryable' => true
), 'objects' );
// Apply default settings
$instance = wp_parse_args($instance, array(
'title' => '',
'post_type' => $this->get_default_post_type($post_types),
'num' => 0,
));
global $SovitFeaturedPost;
$title = esc_attr( $instance[ 'title' ] );
$type = esc_attr( $instance[ 'post_type' ] );
$num = (int) esc_attr( $instance[ 'num' ] );
]]>
Hi
I see a post type “Events” in the widget for sidebar. But the featured events do not display in that widget. Can anybody tell me why the featured events are not displaying?
]]>what is the file name for that code line.
as you ges i am new to wordpress.
Thanks a lot for your time
How do you mark a custom post type post as featured? It does not even show up on custom post types.
]]>It would be great if there was an option to set the post as featured in the edit screen,
]]>Hi,
I’m using your plugin and it’s working great to display featured posts, but what if I’d like to show beside them just the regular posts?
I tried the query :
query_posts($query_string.”&featured=no”);
But it is still showing up featured posts..
Do you guys know what to do?
Thanks in advance
Mathieu