• Resolved cgfx360

    (@cgfx360)


    I’m working on a custom theme for a friend, and have been having issues with making a image editable.

    View post on imgur.com

    I want to make the image below the nav bar (the image of tile) changeable, but remain in that place at that size…

    In otherwords, if my friend decides “Hey! I want to change that image!” he can do it without needing to go into the template files and edit the code…

    Is there any way to achieve this? I’ve been trying everything I could think of.

Viewing 4 replies - 1 through 4 (of 4 total)
  • When I have that sort of thing to do I will set up the featured image to display in that area, and use add_image_size() to resize the image to the right size when it’s uploaded. That way you’ll make it very easy on your freind, as they’ll only need to remember to set the featured image, and everything else will work itself out for them.

    Thread Starter cgfx360

    (@cgfx360)

    I thought that would be perfect if possible…

    But how do i set the featured image to display there? I haven’t been able to figure out the code to do that…

    That bit is easy. 😉 You would use add_image_size() as i said before to define the dimensions for your required size. In this example, I’ve used your_header_size_name as a name so change that to your own name when you set that up.

    <?php if (has_post_thumbnail ()): ?>
        <?php the_post_thumbnail ('your_header_size_name'); ?>
    <?php endif; ?>

    Note that this was written from memory, not something that I’ve copied froma workign site, but it should be very close to working.

    Thread Starter cgfx360

    (@cgfx360)

    Thank you 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Editable Image’ is closed to new replies.