WordPress.org

Ready to get started?Download WordPress

Forums

Removing header images, keep in library (8 posts)

  1. sjohnso3
    Member
    Posted 2 months ago #

    I want to use random headers on my website. One of the images I originally thought I'd use was one that was already in my media library and I selected it from there. But now I no longer want to use it as a header. HOWEVER, I still use the image throughout the site (not as a header) so I don't want to delete the image from the media library. Is there another way to tell WordPress to stop associating an image with the header? I'm not afraid to go into file manager in my host or play with the MySQL database - I just don't know what to look for.

  2. The Grey Parrots
    Member
    Posted 2 months ago #

    what theme are you using?

  3. sjohnso3
    Member
    Posted 2 months ago #

    I'm using the Spacious theme. But I think the random header option is just part of the basic wordpress codex, isn't it?

  4. The Grey Parrots
    Member
    Posted 2 months ago #

    Can you kindly share a snap of that configuration page.

  5. sjohnso3
    Member
    Posted 2 months ago #

    Happy to!

    Here is the configuration page. You see two headers uploaded. I want to remove the first image, but I use that image in other posts on the site so I don't want to delete it from the media library.

    Config page.

    And here is where I can see in the media library that the image file has been marked as a header.

    Media Library

  6. The Grey Parrots
    Member
    Posted 2 months ago #

    As I can see, there is no such option with your theme.

    Kindly try to change the image with a new image first.

    After that Delete the new image from Media Library.

  7. sjohnso3
    Member
    Posted 2 months ago #

    That is not a viable solution for me because I use the image elsewhere so I don't want to delete it from the media library.

    However, with a little trial and error and browsing in phpMy Admin, I figured it out. Here's what I did for anybody else in the situation.

    I went into the wordpress database and to the table _postmeta and looked in the meta_key for content with the word "header" and discovered two entries that had "_wp_attachment_is_custom_header" as the meta_key. As I had two images currently uploaded as "headers" this seemed promising. I looked at the post_id in the two entries and the post_id corresponded to the post_id of the two header images. Even more promising! I went back into wordpress, uploaded another image as a header, and voila! A third entry in _postmeta with "_wp_attachment_is_custom_header" appeared. I had it!

    So, I simply deleted the table entry for the image I no longer wanted WordPress to consider a header, refreshed the header configuration page, and the image was no longer displaying as an uploaded image. I checked my media library and the image was still there (yippee!) but it no longer had "Header Image" noted next to the file name.

    Not for the faint of heart, but worth it so I didn't have to delete and re-upload the image and fix links to the old image across the site.

  8. The Grey Parrots
    Member
    Posted 2 months ago #

    Its a bit risky. But congrats, you did that.:)

Reply

You must log in to post.

About this Topic