Remove header image on image post pages in Wordpress
-
Wordpress: help me get rid of the header image on image post pages. I'm in the process of learning to edit Wordpress themes and I'm stuck on a particular problem: how get rid of the header image on image post pages. Currently, when a thumbnail for an image is clicked you are then brought to a page with the image at full size. But, because of the large header image, you have to scroll down a bit to see it - clunky. I want to remove the header image on those pages (and only those pages). The URL for the website I am working on is in the About section of my profile if you want to take a peek. I'm using a child theme based on TwentyEleven. I did already post this question to the Wordpress forums a bit ago and have not yet heard back.
-
Answer:
In header.php find: $header_image = get_header_image(); if ( $header_image ) : and replace it with: $header_image = get_header_image(); if ( $header_image && !is_attachment()) :
jammy at Ask.Metafilter.Com Visit the source
Other answers
I believe you want to create a attachment.php that's a copy of your index.php. Inside this attachment.php file, remove whatever code your header is in. If you still need *parts* of the header on that page, then you may need to do as Memo suggests, and surround your header call with: <?php if (!is_attachment): ?>...header img tag, etc...<?php endif; ?>This obviously depends on how the theme was built. Also, WordPress Forums are less good than the http://wordpress.stackexchange.com/.
artlung
thank you both! i used Memo's method and it is working peachy.
jammy
Related Q & A:
- How To Remove Burstly Image Cache?Best solution by android.net
- Why do Wordpress rewriites seem to work differently for posts vs pages?Best solution by WordPress
- How to get featured image from Wordpress?Best solution by Stack Overflow
- How can I display older custom post outside the loop in Wordpress?Best solution by Quora
- How to change category of a post automatically in WordPress?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.