Filter posts showing in Footer

Viewing 4 posts - 1 through 4 (of 4 total)
  • #5065
    Notice: Trying to get property of non-object in /var/html/www/wp/wp-content/plugins/fv-gravatar-cache/fv-gravatar-cache.php on line 244 KB
    Participant

    I am having posts that are in ‘Pending’ status showing up in the footers in the ‘most commented’ section because I have a program that imports my posts and comments from Google+.

    How can I filter out posts that have not been published?

    Thanks.

    #5088
    Notice: Trying to get property of non-object in /var/html/www/wp/wp-content/plugins/fv-gravatar-cache/fv-gravatar-cache.php on line 244 Daniel Tara
    Keymaster
    Notice: Trying to get property of non-object in /var/html/www/wp/wp-content/plugins/fv-gravatar-cache/fv-gravatar-cache.php on line 244 Notice: A non well formed numeric value encountered in /var/html/www/wp/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118 Notice: A non well formed numeric value encountered in /var/html/www/wp/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119 Notice: A non well formed numeric value encountered in /var/html/www/wp/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118 Notice: A non well formed numeric value encountered in /var/html/www/wp/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

    I have checked the theme’s function clearly selects only posts that are published, however it’s doing it in an old-fashioned way. Try opening the file functions.php and for the function list_most_commented change the line:

    with:

    • This reply was modified 8 years, 9 months ago by  Daniel Tara.
    #5437
    Notice: Trying to get property of non-object in /var/html/www/wp/wp-content/plugins/fv-gravatar-cache/fv-gravatar-cache.php on line 244 KB
    Participant

    THANKS!

    This worked and got rid of the pending posts… but it doesn’t seem to be counting the posts right. It shows three that have a few comments on them but the one that has the most comments isn’t in the list.

    Does this take some time for it to recalibrate or should I look at something?

    #5471
    Notice: Trying to get property of non-object in /var/html/www/wp/wp-content/plugins/fv-gravatar-cache/fv-gravatar-cache.php on line 244 Daniel Tara
    Keymaster
    Notice: A non well formed numeric value encountered in /var/html/www/wp/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 118 Notice: A non well formed numeric value encountered in /var/html/www/wp/wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php on line 119

    Sorry I made a type, here’s the correct code:

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.