diegonavland
Forum Replies Created
-
Forum: Plugins
In reply to: [WTI Like Post] More than a number of LikesThanks but I’m still getting the same error, the new code is something like this:
function hotposts($query){
global $wpdb;
if( is_home() && $query->is_main_query() ){
$min_value = 5;$query = “SELECT post_id, SUM(value) AS like_count, post_title, post_author FROM {$wpdb->prefix}wti_like_post L, {$wpdb->prefix}posts P
WHERE L.post_id = P.ID AND post_status = ‘publish’ GROUP BY post_id HAVING SUM(value) > $min_value”;
}$result = $wpdb->get_results($query);
}
add_action(‘pre_get_posts’, ‘hotposts’);Any other ideas on what may be happening? Or is there another way to do this?
Forum: Plugins
In reply to: [WTI Like Post] More than a number of LikesThanks for the reply, but I’m getting an error:
Fatal error: Call to a member function is_singular() on a non-object
I placed the code with pre_get_posts like this:
function hotposts($query){
if( is_home() && $query->is_main_query() ){
$min_value = 5;$query = “SELECT post_id, SUM(value) AS like_count, post_title, post_author FROM {$wpdb->prefix}wti_like_post L, {$wpdb->prefix}posts P
WHERE L.post_id = P.ID AND post_status = ‘publish’ GROUP BY post_id HAVING SUM(value) > $min_value”;
}
}
add_action(‘pre_get_posts’, ‘hotposts’);Forum: Plugins
In reply to: [Popular Widget] Feature Request: Add Tab to Show Custom CategoryDenis did you found out how to do that?
Forum: Plugins
In reply to: [Popular Widget] Function for display in the postsCould you please explain further how to place that code? I’m a rookie here.
Forum: Plugins
In reply to: [Frontier Post] Featured ImageBy the firs image added you mean, the first one added with the “add media” button?
Still can’t figure it out, does anybody have an idea?