bootstrapwp_autoset_featured_img Image size #108

jonohale opened this Issue Feb 26, 2013 · 1 comment


None yet

1 participant


I've noticed that this function does not use the wordpress thumbnail size options set in the admin section.

I'm also trying to call the size using wordpress standard way, e.g. bootstrapwp_autoset_featured_img('thumbnail') But i see there is no code for it, and can't figure out how to add it.

Code currently looks like this after my testing:

function bootstrapwp_autoset_featured_img() {
$post_thumbnail = bootstrapwp_post_thumbnail_check();

  if ($post_thumbnail == true ){

return the_post_thumbnail('thumbnail');


if ($post_thumbnail == false ){

  $image_args = array(

            'post_type' => 'attachment',

            'numberposts' => 1,

            'post_mime_type' => 'image',

            'post_parent' => $post->ID,

            'order' => 'desc',

            'size' => 'thumbnail',


  $attached_image = get_children( $image_args );

         if ($attached_image) {

                            foreach ($attached_image as $attachment_id => $attachment) {

                            set_post_thumbnail($post->ID, $attachment_id);


        return the_post_thumbnail( array(65,65) );

      } else { return " ";}


  }  //end function

Also, being able to just call the image URL would be awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment