Resizing old post thumbnail images

I’ve figured this out. Appears as though I really wanted add_image_size(‘post’, 475, 475, true); and then reran the Regenerate Thumbnails plugin. After sorting out a permissions error on /wp-content/uploads, this worked great. Then in my theme, I just displayed this image size for the post thumbnail. the_post_thumbnail(‘post’);

If no featured image, add one of the default images into DB

Im not sure about the random part. But to set a back up featured image if none is set just use <?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } else { ?> <img src=”https://wordpress.stackexchange.com/questions/96146/<?php bloginfo(“template_directory’); ?>/images/default-image.jpg” alt=”<?php the_title(); ?>” /> <?php } ?> Or something like this without major template edits function autoset_featured() { global … Read more

Add title to image post

Sorry, but I don’t see any of those parameters in the parameter list for wp_get_recent_posts. $args = array( ‘numberposts’ => 10, ‘offset’ => 0, ‘category’ => 0, ‘orderby’ => ‘post_date’, ‘order’ => ‘DESC’, ‘include’ => , ‘exclude’ => , ‘meta_key’ => , ‘meta_value’ =>, ‘post_type’ => ‘post’, ‘post_status’ => ‘draft, publish, future, pending, private’, ‘suppress_filters’ … Read more

Add image size array to a portfolio thumbnail in combination with Masonry Jquery Plugin

the_post_thumbnail() only retrieves the specified thumbnail size for the current post. You’ll need to write a conditional function or use a custom query to randomize the posts shown or thumbnail sizes from your theme’s loop. If you are familiar with where your loop starts, then: $tile_sizes = array(‘small’,’medium’,’category-thumb’); LOOP STARTS $random_size = rand(0,2); $chosen_size = … Read more

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