WordPress.org

Ready to get started?Download WordPress

Forums

Custom Featured Image Size as Background (1 post)

  1. AJ Troxell
    Member
    Posted 3 years ago #

    I am currently using

    <?php
    $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 5600,1000 ), false, '' );
    ?>

    To display a featured image as a background image within a div.

    But because of the way that WordPress displays background images I would prefer it only pull and load the "thumbmail" version, as apposed to uploading an additional image on each post that is already sized properly.

    IS is possible to specify, within the code I am using, for it to pull only the thumb version, or a add_image_size called "Featured" that I have placed in my functions.php file.

    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.