Newbie! - Help change style for header

Hi there,
I am totally new to PHP so please bare with me

I have a Wordpress theme that carries the same header throughout its pages. I want to change the header for the static front-page only and keep the rest the same. I was trying to study the PHP in the functions.php file and came across the following code:
[php]
function wi_page_header() {
$title = ‘’;
$subtitle = ‘’;

if ( is_front_page() && is_home() ) {
	$title = get_theme_mod( 'wi_default_blog_title' );
	$subtitle = get_theme_mod( 'wi_default_blog_subtitle' );
} elseif ( is_singular( 'post' ) ) {
	$title = get_the_title();
	$subtitle = get_the_date() . ' - ' . get_the_category_list( ', ' );
} elseif ( is_home() ) {
	$blog = get_post( get_option( 'page_for_posts' ) );
	$title = $blog->post_title;
	$subtitle = get_post_meta( $blog->ID, 'wi_subtitle', true );
} elseif ( is_tax() ) {
	$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
	$title = $term->name;
	$subtitle = category_description();
} elseif ( is_category() ) {
	$title = single_cat_title( '', false );
	$subtitle = category_description();
} elseif ( is_tag() ) {
	$title = single_tag_title( '', false );
	$subtitle = tag_description();
} elseif ( is_day() ) {
	$title = get_the_date();
	$subtitle = __( 'Daily archives', 'weekend' );
} elseif ( is_month() ) {
	$title = get_the_date( 'F Y' );
	$subtitle = __( 'Monthly archives', 'weekend' );
} elseif ( is_year() ) {
	$title = get_the_date( 'Y' );
	$subtitle = __( 'Yearly archives', 'weekend' );
} elseif ( is_author() ) {
	$title = get_the_author();
	$subtitle = __( 'Author archives', 'weekend' );
} elseif ( is_search() ) {
	$title = __( 'Search results for: ', 'weekend' ) . get_search_query();
} elseif ( is_404() ) {
	$title = __( 'Error 404', 'weekend' );
	$subtitle = __( 'Page not found', 'weekend' );
} else {
	$title = get_the_title();
	$subtitle = get_post_meta( get_the_ID(), 'wi_subtitle', true );
}

echo '<div class="page-header">';
	echo '<div class="container">';
		echo '<div class="twelve columns">';
			echo '<h1 class="page-title text-alt">' . $title . '</h1>';
			if ( $subtitle ) {
				echo '<div class="page-subtitle">' . $subtitle . '</div>';
			}
		echo '</div>';
	echo '</div>';
echo '</div>';

}
[/php]

I’ve tried various things to try and alter this and have it affect the static front-page only, all but to no avail.

I added a new div ID in the style.css called “portfolio-header” and changed the styling when experimenting but couldn’t get it to apply only to that one page.

Hope someone can help and give me some direction! I am truly a beginner when it comes to PHP and Wordpress :smiley: I am really trying though!

Regards
Rachael

First if you are doing any modifications to a theme, you are going to want to use a child theme not the main.

Why do you want to change the header for a single page? What you can do, is add a new style sheet for the header in the static page. That should override the original stylesheets rules.

Sponsor our Newsletter | Privacy Policy | Terms of Service