Change you constructor to this
public function __construct($post)
{
$this->set_bio($post->post_content);
$thumbnail = get_the_post_thumbnail_url($post->ID);
$this->set_thumbnail($thumbnail);
}
and remove thumbnail code from init method.
Related Posts:
- Inconsistent temporary 404s on whole install | PHP error with post-template.php
- Custom post status not working
- Search that will look in custom field, post title and post content
- Load custom posts with same tag as page
- Date archives for custom post type
- If featured image doesn’t exist, show post content
- How can I add dropdown widget/box to admin post page?
- Meta Query “IN” doesn’t work with ACF checkbox filter
- How do I redirect all 404 errors of a specific post type to another URL?
- Filter posts with ajax form and checkboxes
- Using ‘strtotime’ function to convert a custom-meta-box to a date-stamp
- How to save the checked boxes?
- How to get only one category of custom post type?
- Error after deleting Custom Post Type with a function (no trash used)
- Append taxonomy terms as class names in markup?
- Change message given when deleting post from custom post type
- wordpress custom post type remove duplicate menu item
- Using WPAlchemy metabox values in another metabox
- List terms from Custom Taxonomy
- WP_Query search posts by custom post type and custom taxonomy
- Display custom field of specific post where post title matches variable
- Loop through posts of a custom-post-type (event) and create .ics (iCal) file?
- How to count custom post types with conditional operators
- GravityForm: Populate Dropdown with custom post type [closed]
- How to output wordpress custom tags separated by comma?
- Show Different Header on a Specific Post ID
- Admin notice not displaying
- Dynamic page outside WordPress
- Using wordpress template tags within an array
- Getting the URL of the parent page
- Custom query to filter posts that have current post as a taxonomy [closed]
- get_posts of Custom Post Type AND Custom Taxonomy
- Get posts from a custom post type by child categories of a parent category
- If post has custom field then display css-class
- Replace text in post from cvs
- Get parent categories of custom post type
- Query & Order posts by custom fields
- Custom Tag Description unable to display just below and outside of the Loop
- Using custom field content as expression in IF statement [closed]
- Can one create multiple Custom Post Types with a for loop?
- How to Upload CSV Data into Custom Post Type Data with Metabox programmatically
- How to add custom field to view-edit post type page
- Static apple-app-site-association file with wordpress
- search suggest – filter post type
- Breaking up CPT output into two columns
- Make a custom_post translatable
- How to update post meta on uploaded image from a custom form?
- Configuring a meta query with multiple post types that have the same relationship on a single page
- how to echo meta tag in header using php
- Trying to get custom post of a custom taxonomy
- PHP question: how to combine syntax?
- Add first letter of titles to array, then compare arrays
- How do I add custom HTML to the content of an archive page’s posts?
- widget_posts_args not using the number of posts in widget
- How To Post WordPress Custom Post Types to Twitter via IFTTT
- Undefined $post in wp_query
- Filter content in shortcode
- Custom post type and custom taxonomy 404 on page 2
- Show current user posts in custom post type query
- Importing JSON feed giving Notice: Array to string conversion error
- List latest post out of 2 custom post types
- Show the categories the current post has
- Front end create custom post types
- Fetch data from two custom post types and create multidimensional array for output to html table
- Create a Dropdown Selector and Redirect for a Custom Taxonomy in WordPress?
- Create an user checklist system for a course plateform using ACF Pro and ACF Extended
- How to get the custom post data using post id in WordPress?
- set object terms after some some time of published post – functions.php
- See if the email exists or not
- Why is my custom post content only viewable when signed into WordPress?
- On saving Post My permalink is updated and category is removed automatically which cause the 404
- Pagination not working in custom post type. Help
- How to add specific terms in a custom post type?
- Limit custom post type to the authors only on front-end!
- WP_Query – How To Query Only Custom Posts With No Children of Their Own?
- programmatically generated custom post type is created more than once
- Dynamic page for nav items used as filters
- How to use posts as tabs in a custom page?
- Accessing download link from the loop with WP Download Manager Pro
- Create posts inside CPT post
- ACF field check value of field on all other articles
- Taxonomies are not showing in the category dropdown
- How to use POST method using custom wordpress button?
- Combine multiple separate lists into one
- News post with multiple permalinks? When opened from different page
- Custom Taxonomy – fields
- WordPress trying to query two custom types to get child from the parent
- Print post category name from a custom post type wordpress
- CPT post doesnt shows tags and category on backend admin page
- How to make sure, that only the selected post is changing?
- Create 2-layered dropdown menus for custom taxonomy and custom post type
- Get month and day from a Date Picker custom field
- Show Custom Post Type taxonomy term that matches custom field
- Select Menu for Custom post Type does not save
- is_singular won’t call my functions?
- Inserting two categories
- Comments are not working on Custom Post Type
- Add Category names to post lists of custom post type
- Custom post type is_singular condtional not working when managing sidebar display
- Issue displaying multiple TinyMCE editors with WPAlchemy