Is there a way to give an option of different LiteSpeed header for different templates like you have in get_header(‘1’) and get_header(‘2’) for header-1.php and header-2.php?
]]>I created a website with different Metaslider headers for different pages. I did this following this method: https://www.ads-software.com/support/topic/meta-slider-integration-in-header-for-specific-pages
However this isn’t difficult enough now I want to have different metaslider headers for my translated pages. Hope I am making myself clear.
I made my translations with Qtranslate and installed the Qtranslage slug plugin. So for example I have the following code in my header php file:
} elseif ( is_page(‘hoe’) ) {
// page with slug page-slug
echo do_shortcode(“[metaslider id=366]”); // You can add as many other pages as you like
And this is working perfectly for my normal Dutch site. But now I want to have the English translation How to have a different metaslider header. So I figured it should be something like:
} elseif ( is_page(‘how’) ) {
// page with slug page-slug
echo do_shortcode(“[metaslider id=326]”); // You can add as many other pages as you like
However this is not working for me. Again I hope it is clear what I would like to do. Thanks so much in advance!
]]><?php $category = get_the_category();
if ($category[0]->category_parent = 'approfondimenti') {
get_header('regular-approfondimenti');
} elseif ($category[0]->category_parent = 'le-tue-campagne-salute') {
get_header('regular-le-tue-campagne-salute');
} else { get_header(); } ?>
The first condition works but the second is totally ignored and the first header gets loaded instead. What am I doing wrong? Thanks for your help.
]]>https://www.ads-software.com/support/topic/different-headers-on-each-page-1?replies=10
This is one of the pages where I’d like a different banner:
https://www.drumdaboom.com/sound-therapy/
This is the code I put into the header:
<?php $header_image = get_header_image();
if(is_page('Sound therapy')){
echo '<img src="https://www.drumdaboom.com/wp-content/uploads/2013/03/banner_therapy.jpg" />';
}
elseif ( ! empty( $header_image ) ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>
<?php endif; ?>
And this is the message I get …
Parse error: syntax error, unexpected ‘:’ in /customers/b/1/b/drumdaboom.com/httpd.www/wp-content/themes/drumdaboum/header.php on line 44
Any suggestions would be greatly appreciated.
]]>get_header();
to
get_header("home");
This works great.
I would like help with adding code to do this:
If the device is max width 480px, then get the regular header.php instead of header-home.php
I would like to know where to put the media query i.e. and code exactly.
Thanks very much!
]]>So far I can either use the animated header by putting it in an iframe or use WP Display Header to display different headers on each page.
Here is the html file I’m using in pastebin.
This is the code in the header.php file for presswork theme:
<?php
/**
* The template for displaying the header.
*
* Displays all of the <head> section and everything up till <ul id="main-wrapper">
* Includes all the action blocks for the header.
*
* @since PressWork 1.0
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<!--[if IE]><![endif]-->
<!--[if lt IE 9]>
<script src="https://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title><?php wp_title('|',true,'right'); ?><?php bloginfo('name'); if(is_front_page()) { echo ' | '; bloginfo('description'); } if ( $paged > 1 ) { echo (' | Page '); echo $paged; } ?></title>
<link rel="profile" href="https://gmpg.org/xfn/11" />
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<?php pw_header_css(); ?>
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php $favicon = pw_theme_option('favicon'); if(!empty($favicon)) echo '<link rel="shortcut icon" type="image/x-icon" href="'.$favicon.'" />'."\n"; ?>
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width" />
<?php wp_head(); ?>
</head>
<!--[if lt IE 7 ]> <body <?php body_class("ie6"); ?>> <![endif]-->
<!--[if IE 7 ]> <body <?php body_class("ie7"); ?>> <![endif]-->
<!--[if IE 8 ]> <body <?php body_class("ie8"); ?>> <![endif]-->
<!--[if IE 9 ]> <body <?php body_class("ie9"); ?>> <![endif<]-->
<!--[if (gt IE 9)|!(IE)]><!--> <body <?php body_class(); ?>> <!--<![endif]-->
<?php pw_actionCall('pw_body_top'); ?>
<div id="body-wrapper" class="clearfix">
<!-- <iframe src="https://localhost:8888/karentestweb.com/wp-content/themes/presswork-child/headerframenew.html" height="390" width="930">Alice Teeter Poetry</iframe> -->
<header id="header-main" role="banner"> <!-- begin header -->
<?php pw_actionBlock('pw_header'); ?>
</header> <!-- end header -->
<ul id="main-wrapper">
Please help, I have no hair left on my head. I have scoured wp codex and support pages to no avail.
]]>Here is the code in my header.php
<div id="header">
<div id="logo">
" title="<?php bloginfo('description'); ?>"><img class="title" src="<?php if ( get_option('sdt_logo') <> "" ) { echo get_option('sdt_logo').'"'; } else { bloginfo('template_directory'); ?>/images/logo2.png<?php } ?>" alt="<?php bloginfo('name'); ?>" />
<h1 class="replace">"><?php bloginfo('name'); ?></h1>
</div>
]]>