• I’m using the Skeleton responsive theme and I’d like to omit the header image from one page, Contact Us. I’ve tried editing the header.php file to add a condition to the original set that would detect the page and prevent the image from being applied. In the code fragment below, the second condition in the “if” statement, “&& !(is_page(‘contact-us’)) is what I added. The slug name of the Contact Us page is definitely ‘contact-us’. I don’t see why the code below wouldn’t allow things to get past the first line when the Contact Us page loads.

    // Check if this is a post or page, if it has a thumbnail, and if it exceeds defined HEADER_IMAGE_WIDTH
    	if ( is_singular() && !(is_page('contact-us')) && current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail( $post->ID )
    	&& ( /* $src, $width, $height */
    	$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ))
    	&&
    	$image[1] >= HEADER_IMAGE_WIDTH ) :
    	// Houston, we have a new header image!
Viewing 7 replies - 1 through 7 (of 7 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Have you tried the page ID or title instead?

    Thread Starter rdmckelvey

    (@rdmckelvey)

    I meant to include a link to the site, a very simple 4-pager at this point…

    https://www.herndonfdn.org/beta/

    Thread Starter rdmckelvey

    (@rdmckelvey)

    I just tried the page ID: !(is_page(14)) and again, the image appears.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Because the Skeleton theme was never published on www.ads-software.com it’s not really a theme we support; we don’t know how well external themes have been following standard theme protocols. The Skeleton theme may not be compatible to Codex’s standards.

    Have you tried contacting the Skeleton theme vendors for support?

    Thread Starter rdmckelvey

    (@rdmckelvey)

    I haven’t tried contact them…I didn’t realize it was not supported here (I posted here after finding an answer to another question about the Skeleton theme code from about a year ago on these forums).

    I’ll see if I can find support for the theme elsewhere. If you don’t mind one last question: the syntax and general logic of what I’m trying to do look reasonable in general?

    thank you for your time!

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    There are no syntax errors in your code snippet & if there were then your whole site would break.

    You’re also using the is_page function correctly by passing the right parameters and expecting the right response from it.

    Thread Starter rdmckelvey

    (@rdmckelvey)

    OK, thanks again… another mystery to solve ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Skeleton-exclude header image from page’ is closed to new replies.