Styling images coming from another blog

I had asked a question earlier, on getting post-thumbnails from another WP-site. There, the awesome Mike coded a SQL query whose results are then passes on to a PHP array. The piece of code from that answer that I want to modify is this. $post_urls = $wpdb->get_col($sql); if (is_array($post_urls)) echo implode(“\n”,$post_urls); Now the array holds … Read more

Getting alt text of featured image

I’m trying to get the alt text of our featured image and have it output on the frontend. Currently my code is <img class=”vehicle-photo” src=”https://wordpress.stackexchange.com/questions/312283/<?php echo the_post_thumbnail_url() ?>” alt=”<?php the_post_thumbnail_caption();?>” /> But on the frontend, it is outputting as <img class=”vehicle-photo” src=”https://wordpress.stackexchange.com/questions/312283/photo url here” alt=””> 2 Answers 2 The alt text is stored as post … Read more

How to check if user is uploading/setting an image as a featured image?

I’m making a limitation for image upload based on @brasofilo excellent snippet. In short, it limits user to only uploading image with minimum dimension. However I want to apply this only when user is uploading a featured image. I tried using $pagenow as a conditional, global $pagenow; if ($pagenow == ‘media-upload.php’) add_filter( ‘wp_handle_upload_prefilter’, ‘wpse_28359_block_small_images_upload’ ); … Read more