Is it possible to show full content of the post when there is only one post in a grid?

not sure how you’re actually displaying your posts whether it’s a custom query and which page your doing your grid, for example a category page. Here’s a little snippet that may help you. //get current category page $category = get_the_category(); //get current category page ID $category_id = $category->cat_ID; //set arguments for your desired posts output … Read more

How to print the thumbnail only if a post has a thumbnail

Try this inside else condition where no image assigned. if (has_post_thumbnail()) { ?><a href=”https://wordpress.stackexchange.com/questions/257634/<?php the_post_thumbnail_url(); ?>”> <?php the_post_thumbnail();?> </a><?php } else { echo ‘<figure><a href=”add_link_here”><img src=”‘.get_bloginfo(“stylesheet_directory”).’/images/stone.jpg” /></figure></a>’; }

Uploading images on front end doesn’t generate thumbnail sizes

wp_generate_attachment_metadata generates metadata for an image attachment. It also creates a thumbnail and other intermediate sizes of the image attachment based on the sizes defined on the Settings_Media_Screen. wp_generate_attachment_metadata() is located in wp-admin/includes/image.php. /* just require image.php before wp_generate_attachment_metadata */ require_once(ABSPATH . ‘wp-admin/includes/image.php’); $attach_data = wp_generate_attachment_metadata( $attach_id, $file ); hope that helps!

How to automatically resize animated GIFs used as Featured Images, without losing animation?

A gif should work as a featured image. Upload the gif as the featured image and display on the post page (single.php) for example, using the following for the original size: the_post_thumbnail(‘full’); In the case of specific image sizes, i.e. <?php the_post_thumbnail( ‘custom-size’ ); ?> WP generates static images and in that case the gif … Read more

Featured Images are not able to be set

You added your own answer in the comments section: There is only one total php warning/error: wp-admin/admin-header.php:9 – Cannot modify header information – headers already sent by (output started at /home/content/p3pnexwpnas13_data03/47/3056147/html/wp-includ‌​es/functions.php:413‌​8) include(‘wp-admin/edit-form-advanced.php’), require_once(‘wp-admin/admin-header.php’), header… The other half of the errors (it’s two different problems you are facing) can also be found in your comments 1) … Read more

Loading custom post thumbnail into stream

You can write a function to grab the featured image by post’s ID, then manipulate it and return it as whatever format you wish. function covert_thumbnail_to_base64($post->ID){ // Get the thumbnail’s URL $thumbnail = get_the_post_thumbnail_url( $post->ID,’thumbnail’ ); // Now, process it the way you want // Return the processed image return $data; } Now you can … Read more