WordPress.org

Support

Support » How-To and Troubleshooting » PHP-Notice on author.php when no posts

PHP-Notice on author.php when no posts

  • Hello my friends,

    i am using that theme: http://press75.com/view/debut/
    WB_DEBUG is true.

    There was no author.php so I made one. it works without problems, but I get a PHP-Notice-Error, wenn I visit an author page from an author, who is registered but doesnt release a post yet:

    Notice: Trying to get property of non-object in C:\xampp\htdocs\wp\wp-includes\post-template.php on line 30

    On line 30 is following code, which is called somewhere in wp_head (dont know where in detail):

    function get_the_ID() {
    	global $post;
    	return $post->ID;
    }

    do u know what can i do to remove that error?

    thanks a lot!

    alex

Viewing 4 replies - 1 through 4 (of 4 total)
  • esmi

    @esmi

    Forum Moderator

    I’m sorry but as you are using a commercial theme, you need to seek support from the theme’s vendors.

    Hm, dont you think this is a general problem related to all themes?

    Maybe anyone has a normal theme and can test it using a author.php and visiting this page of a user who has no posts (WB_DEBUG true!)?

    when this php-notice is at every theme, so i can live with this notification…

    esmi

    @esmi

    Forum Moderator

    dont you think this is a general problem related to all themes?

    Sorry but no. I often include an author.php template file in my themes and I’ve never seen this error. So it would appear to be specific your the theme. Or your author template file.

    maybe you didnt see this error, because you never visit a author page from an author who has no written post?

    at an regular blog this case common does not exist – but i am using wordpress as a kind of community.

    maybe i will try it with a new installation…thank u

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP-Notice on author.php when no posts’ is closed to new replies.