So I'm wanting to target the thumbnail but I'm not able to find it successfully. If someone could point me in the right direction I'd really appreciate it.
Could anyone point me in the right direction to target thumbnail?
Here is my class:
class Profile
{
// Private variables to hold data
private $bio;
private $thumbnail;
// Initialize the object's id property
public function __construct($post)
{
$this->set_bio($post->post_content);
$this->set_thumbnail($this->thumbnail);
}
// Create the init method that calls the registered post type and pass in a id parameter
public static function init($id)
{
$post = get_post($id);
var_dump($post);
$thumbnail = get_the_post_thumbnail_url($id);
var_dump($thumbnail);
$profile = new Profile($post);
// Call to return the profile so that `Profile::init($id)` works.
return $profile;
}
public function set_bio($bio)
{
$this->bio = $bio;
}
public function get_bio()
{
return $this->bio;
}
public function set_thumbnail($thumbnail)
{
$this->thumbnail = $thumbnail;
}
public function get_thumbnail()
{
return $this->thumbnail;
}
}