Edits to Excerpts from children Widget – Thumbnail image not working
-
I’ve been working on editing this widget a bit so that it will work with calling the built in excerpt editor of WP. I managed to get that part working, but now the thumbnail is no longer working. I’m hoping someone can have a look at the code and see if there is something I’m missing. I’m no PHP expert, and have spent hours going through the forum trying a lot of ideas to no avail.
Another idea I have is to create a template file for a page with subpages, but I’m hitting a brick wall here too.
function excerpts_from_children($attrs) { global $wp_query; $params = $wp_query->get_queried_object(); $children = get_pages('sort_column=menu_order&parent=' . $params->ID . '&child_of=' . $params->ID); $output = ""; foreach ($children as $child) { $output .= "<div class=\"excerpts-from-children\">"; if( has_post_thumbnail() ) { $output .= "<img src=\"" . $child->the_post_thumbnail( 'thumbnail' ) . "\" title=\"" . $child->post_title . " thumb\" />"; } $output .= "<h3>" . $child->post_title . "</h3>"; $output .= "<p>" . $child->post_excerpt . "</p>"; $output .= '<p class="read-more"><a href="' . get_bloginfo('url') . '/'. make_clickable(get_page_uri($child->ID)) . '">Read more »</a></p>'; $output .= "</div>"; } return $output; }
- The topic ‘Edits to Excerpts from children Widget – Thumbnail image not working’ is closed to new replies.