Retain the original name of the image on resize

You can simply use preg_replace() functions to remove -800×667 (or any height) from the image. Like this- $image = generate_filename( NULL, NULL, ‘jpg’); echo preg_replace( ‘/-800x[0-9]{2,4}/’, ”, $image );

category image taxonomy

Found a solution: <?php $cat = get_the_category(); $category_id = $cat[0]->term_id; foreach (get_the_category() as $cat) : $attachmentId = get_option(“category_image_{$category_id}”, ‘null’); $imageArr = wp_get_attachment_image_src( $attachmentId, ‘medium’ ); $imageURL = $imageArr[0]; echo ‘<img src=”‘ . $imageURL . ‘” />’; endforeach; ?>

Background image not appearing

custom background can be used in below way: $defaults = array( ‘default-color’ => ”, ‘default-image’ => ”, ‘default-repeat’ => ”, ‘default-position-x’ => ”, ‘default-attachment’ => ”, ‘wp-head-callback’ => ‘_custom_background_cb’, ‘admin-head-callback’ => ”, ‘admin-preview-callback’ => ” ); add_theme_support( ‘custom-background’, $defaults ); Example usage: $args = array( ‘default-color’ => ‘000000’, ‘default-image’ => ‘%1$s/images/testback.jpg’, ); add_theme_support( ‘custom-background’, $args … Read more