Support » Themes and Templates » Object unavailable inside content.php

  • Resolved JonathanMH

    (@jonathanmh_com)


    I have a class in my themes function.php. Calling methods of the created object works fine in index.php, but not in content.php.

    The error I get:
    Fatal error: Call to a member function post_thumbnail() on a non-object in [path of file]

    var_dump for my object in index.php:
    object(Ancestor)#168 (0) { }

    var_dump for my object in content.php:
    NULL

    My thought is, that is has something to do with http://codex.wordpress.org/Function_Reference/get_template_part

    How can I work around this?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Object unavailable inside content.php’ is closed to new replies.