WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Broken Header Image Links in Twenty Eleven Theme (10 posts)

  1. nitin_george@yahoo.com
    Member
    Posted 2 years ago #

    Hi,

    I have one broken image link on my word press site that I have been struggling to get rid off. Some additional details that might help with the troubleshooting:

    The site is at: http://www.countrypolo.co.uk

    If I look at the page source (inspect element on the image that is missing) on the admin console I can see that the url is wrong and in fact it does not point to an image at all.

    Any help with this would be much appreciated and happy to provide more information. Thanks.

  2. Anthony Hortin
    Member
    Posted 2 years ago #

    Can you please provide some more information as to what part of the page or post is missing an image. Is it on the actual homepage url that you mentioned?

  3. nitin_george@yahoo.com
    Member
    Posted 2 years ago #

    Thanks for the quick response.

    If you visit the site again you will find the header image missing. I had a valid image loaded earlier which is why you probably did not notice the problem when you first visited the site.

    I want to be able to delete this invalid/missing image from the list of custom uploaded headers in the admin console so that I can enable the random selection of header images. If I do it right now, every once in a while a visitor to the site will encounter this image.

    As you probably noticed I am using the Twenty Eleven theme.

    I hope I am explaining the situation/problem clearly.

    Nitin

  4. nitin_george@yahoo.com
    Member
    Posted 2 years ago #

    I should also mention that I thought of deleting the image from the 'media' library but this invalid image does not appear in the list of uploaded images in the library.

  5. Anthony Hortin
    Member
    Posted 2 years ago #

    Thanks for you explanation. That makes more sense although it sounds like it might be a little difficult to remove. Unfortunately, in the Twenty Eleven theme, clicking the "Remove Header Image" button simply removes it from the site but leaves it in the list of uploaded headers. As you've seen, it's not a valid image and if it's not displaying in the Media library it obviously can't be deleted from there either.

    The only other option I can see is to remove it manually from the database using a tool like phpMyAdmin, which is usually provided in most hosting packages. If you're not familiar with using this tool then it's best not too as deleting the wrong data can obviously cause all sorts of issues with your site.

    Have you used phpMyAdmin before? If not, and you're comfortable providing me with access to your hosting account, I can have a look in your database and delete the offending data for you. Let me know how you'd like to proceed and if you'd like me to take a look I'll provide you my email address.

    Thanks,
    Anthony.

  6. nitin_george@yahoo.com
    Member
    Posted 2 years ago #

    Anthony, I'm reasonably comfortable working with the database so if you are able to give me specific instructions on what to modify, I should be able to do it myself otherwise I guess I will need to provide you the credentials to access the server.

    Let me know what you think is best. Thanks.

  7. Anthony Hortin
    Member
    Posted 2 years ago #

    In that case, I'll leave you to do it. Just a couple of notes to start...

    * Can't stress this enough: Before you start, please make sure you do a backup of your database. You can never be too careful! *

    * The table names that I make reference to start with "WP_". Depending on how your WordPress setup was configured, it's possible that your table names start with something else, as this can be set in the WP configuration file. *

    Within phpMyAdmin, open your database. Using the "SQL" tab, run the following query

    SELECT * FROM wp_postmeta where meta_value = 'custom-header'

    This will display all rows within WP_POSTMETA that are your custom header images.

    Make a note of the value(s) in the POST_ID column. Depending how many header images have been uploaded, you may get multiple rows returned.

    Run the following query, replacing "value1, value2, value3" with a comma seperated list of the POST_ID's you wrote down from the previous query. If the last query only returned one row, then simply put that single figure in the brackets

    SELECT * FROM wp_posts where id in (value1, value2, value3)

    The header row that you want to delete should be returned using this query. Look at the POST_NAME column to determine which row to delete. Hopefully it will contain part of the img name that is causing the problems. You can click the red "X" at the very left of a row, to delete that single row of data. Make a note of the number in the ID column for the row that you delete.

    Run the following query, replacing "post-id-value" with the value you wrote down in the previous step (ie. the row that you deleted)

    SELECT * FROM wp_postmeta where post_id = post-id-value

    This will return multiple rows from WP_POSTMETA that are related to the data contained in the WP_POSTS table. There will most likely be 4 rows returned. You can delete these 4 rows.

    You should now be able to return to your WordPress Dashboard and hopefully when you view the APPEARANCE > HEADER menu option, the offending header will no longer be there.

    If all worked well, pat yourself on the back and go have a coffee! ;-)

  8. nitin_george@yahoo.com
    Member
    Posted 2 years ago #

    Thanks Anthony. Will let you know how this turns out. Got my fingers crossed.

  9. nitin_george@yahoo.com
    Member
    Posted 2 years ago #

    Just came out of surgery. Everything looks great - the patient is hale and hearty... :)

    OK but jokes apart, thanks for the great step by step guide on how to fix this Anthony. I could not have done this without your help.

    Cheers,
    Nitin.

  10. Anthony Hortin
    Member
    Posted 2 years ago #

    WooHoo! That's my pleasure! Glad to hear it's all looking good! :-)

    Cheers,
    Anthony

Topic Closed

This topic has been closed to new replies.

About this Topic