Reply To: Custom page header in taxonomy archive page

Home Forums Support Custom page header in taxonomy archive page Reply To: Custom page header in taxonomy archive page

#210903
Tom
Lead Developer
Lead Developer

Hmm, you would need to split it up into two functions:

add_action( 'generate_before_header', 'fm_titol_projectes_before');
function fm_titol_projectes_before() {
	$queried_object = get_queried_object(); 
    if ( is_tax("tipus_producte") && !is_front_page()) {
		echo '<div class="page-header-content parallax-enabled generate-page-header generate-content-header" style="background-image: url('. get_stylesheet_directory_uri() .'/images/back-header-piscines.jpg);background-size:cover">
			<div class="inside-page-header-container inside-content-header generate-merged-header grid-container grid-parent ">';
	}	
}

add_action( 'generate_after_header', 'fm_titol_projectes');
function fm_titol_projectes() {
	$queried_object = get_queried_object(); 
    if ( is_tax("tipus_producte") && !is_front_page()) {
		echo '<div class="generate-combined-content grid-container grid-parent">
				<div class="generate-inside-combined-content">
					<h1 style="margin:0;text-shadow: 0 0 6px rgba(0,0,0,.6)">'. $queried_object->name .'</h1>
				</div>
			</div>
			</div>
		</div>';
	}	
}

Not 100% sure it will work at all, but worth a shot 🙂