Change headline text for post thumbnail meta box

Featured Image box is internally a meta box, added using add_meta_box (ref. edit-form-advanced.php line no. 128). As far as my research went, there is no filter applied to the meta box title (ref. template.php line no. 846). Hence you cant change the metabox title using a filter. Though you can try printing the contents of … Read more

Thumbnail Cropping with add_image_size?

Refer to the add_image_size() Codex entry: <?php add_image_size( $name, $width, $height, $crop ); ?> The $crop parameter is the key: (boolean) (optional) Crop the image or not. False – Soft proportional crop mode ; True – Hard crop mode. Default: false That is: False (default): box-resize – (resize image against the constraining dimension) True: hard-crop … Read more

Can’t get image size set with set_post_thumbnail_size() function

They work independently of eachother. You need to call the one you created in the functions.php. So in your functions.php you would have something like: if (function_exists(‘add_theme_support’)) { add_theme_support( ‘post-thumbnails’ ); set_post_thumbnail_size( 75, 75, true ); // default thumbnail size add_image_size(‘my-custom-thumb’, 80, 80, true); //custom size } and then to call your custom thumbnail you … Read more

Get the 5 lastest Featured Posts from a category

<?php /* Set the name of the category and the number os posts to be displayed */?> <?php $first_query = new WP_Query(‘category_name=name&posts_per_page=7’); ?> <?php /* Show the posts */ ?> <?php while ($first_query->have_posts()) : $first_query->the_post(); ?> <?php /* Make the hiperlink to the post */ ?> <a href=”https://wordpress.stackexchange.com/questions/59934/<?php the_permalink(); ?>”> <?php /* Get the featured … Read more

Change featured image urls in database

The featured image is stored in the *_postmeta table under the _thumbnail_id key. In fact, chances are that you’ve got a lot of image/media urls in that table, which you haven’t changed. The problem is that a number of things are stored in serialized arrays and changing them with SQL as above will (probably) break … Read more

Remove image classes from post thumbnail output

You might try something like this in your functions.php: //remove class from the_post_thumbnail function the_post_thumbnail_remove_class($output) { $output = preg_replace(‘/class=”.*?”https://wordpress.stackexchange.com/”, ”, $output); return $output; } add_filter(‘post_thumbnail_html’, ‘the_post_thumbnail_remove_class’);