Thumbnail is showing outside its div instead of inside it

the_post_thumbnail() echo the output, hence that’s why the thumbnail is misplaced. To manually echo the output, you should use get_the_post_thumbnail() instead: echo ‘<div class=”post-image right”>’ . // wrapped get_the_post_thumbnail(null, ‘featured-portrait-large’) . ‘</div>’; Or you can instead do this: echo ‘<div class=”post-image right”>’; the_post_thumbnail(‘featured-portrait-large’); echo ‘</div>’;

Why are thumbnails not being generated for PDF files?

I found a solution! I hope this helps save some time and frustration for others that might encounter this problem. It turns out that it isn’t WordPress or PHP. After a lot of digging, I came across this discussion by some members of the WordPress Core team: https://core.trac.wordpress.org/ticket/48853. It says that there is some kind … Read more

Show image in excerpt post. Image not displaying

If you add support for Post Thumbnails, you can use its own function instead of get_post_meta(), see codex for more information – http://codex.wordpress.org/Post_Thumbnails#Function_Reference Use following code in your theme: <div class=”postcont> <?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } the_excerpt(); ?> </div> EDIT And using the OP’s code: $args = array( ‘numberposts’ => 5, ‘category’ … Read more

Post Gallery list attachments except the one used as post thumbnail

You can use the exclude parameter. global $post; $args = array( ‘exclude’ => get_post_thumbnail_id( $post->ID ) ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘numberposts’ => -1, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ‘post_parent’ => $post->ID ); $images = get_posts($args); http://codex.wordpress.org/Template_Tags/get_posts http://codex.wordpress.org/Function_Reference/get_post_thumbnail_id

Custom image size mixes width and height in output

The “medium” and “large” are not custom image sizes – they are already part of the core WordPress media sizes and they should be handled via the “settings” -> “media” options page in wp-admin. Give your custom image sizes a different and more unique name (reserved are thumbnail, medium, large, full)

Dynamic image crop in WP 3.0+?

http://codex.wordpress.org/Class_Reference/WP_Image_Editor http://codex.wordpress.org/Function_Reference/wp_get_image_editor $image = wp_get_image_editor( ‘cool_image.jpg’ ); if ( ! is_wp_error( $image ) ) { $image->rotate( 90 ); $image->resize( 300, 300, true ); $image->save( ‘cool_image.jpg’ ); } Repalce cool_image.jpg with a variable holding the path to the image you want to edit. Not a copy and paste solution but should put u on the right … Read more

Show posts image attachments

See the below code. <?php $args = array( ‘posts_per_page’ => -1, ‘order’=> ‘DESC’, ‘orderby’ => ‘date’ ); $postslist = get_posts( $args ); foreach ( $postslist as $post ) : setup_postdata( $post ); ?> <div> <?php $args = array( ‘post_type’ => ‘attachment’, ‘posts_per_page’ => -1, ‘post_status’ =>’any’, ‘post_parent’ => $post->ID ); $attachments = get_posts( $args ); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)