Title: add custom php to the header.php &#8211; to integrate metaslider
Last modified: August 22, 2016

---

# add custom php to the header.php – to integrate metaslider

 *  [say_hello](https://wordpress.org/support/users/say_hello/)
 * (@say_hello)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/add-custom-php-to-the-headerphp-np/)
 * galileo
 * hello dear workdpress fans and user
 * wnt to add metslider
 * to a new installed workdress version 4.0
    the sytstem is just great
 * i ve added a meta-slider and now i want the slider to appear in the center of
   the header. But how to do that!?
 * well the quesion is – how to add the shortcode
 * see the shorcode here
 *     ```
       metaslider id=61]
       ```
   
 * My guess:
 * to the header PHP i have to add the folloiwng
 * see the** header.php** of my theme
 *     ```
       <?php endif;
       echo do_shortcode("[metaslider id=6]");
       ?>
   
       <?php
   
       // Exit if accessed directly
       if( !defined( 'ABSPATH' ) ) {
       	exit;
       }
   
       /**
        * Header Template
        *
        *
        * @file           header.php
        * @package        Responsive
        * @author         Emil Uzelac
        * @copyright      2003 - 2014 CyberChimps
        * @license        license.txt
        * @version        Release: 1.3
        * @filesource     wp-content/themes/responsive/header.php
        * @link           http://codex.wordpress.org/Theme_Development#Document_Head_.28header.php.29
        * @since          available since Release 1.0
        */
       ?>
       	<!doctype html>
       	<!--[if !IE]>
       	<html class="no-js non-ie" <?php language_attributes(); ?>> <![endif]-->
       	<!--[if IE 7 ]>
       	<html class="no-js ie7" <?php language_attributes(); ?>> <![endif]-->
       	<!--[if IE 8 ]>
       	<html class="no-js ie8" <?php language_attributes(); ?>> <![endif]-->
       	<!--[if IE 9 ]>
       	<html class="no-js ie9" <?php language_attributes(); ?>> <![endif]-->
       	<!--[if gt IE 9]><!-->
       <html class="no-js" <?php language_attributes(); ?>> <!--<![endif]-->
       	<head>
   
       		<meta charset="<?php bloginfo( 'charset' ); ?>"/>
       		<meta name="viewport" content="width=device-width, initial-scale=1.0">
   
       		<title><?php wp_title( '|', true, 'right' ); ?></title>
   
       		<link rel="profile" href="http://gmpg.org/xfn/11"/>
       		<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"/>
   
       		<?php wp_head(); ?>
       	</head>
   
       <body <?php body_class(); ?>>
   
       <?php responsive_container(); // before container hook ?>
       <div id="container" class="hfeed">
   
       <?php responsive_header(); // before header hook ?>
       	<div id="header">
   
       		<?php responsive_header_top(); // before header content hook ?>
   
       		<?php if( has_nav_menu( 'top-menu', 'responsive' ) ) { ?>
       			<?php wp_nav_menu( array(
       								   'container'      => '',
       								   'fallback_cb'    => false,
       								   'menu_class'     => 'top-menu',
       								   'theme_location' => 'top-menu'
       							   )
       			);
       			?>
       		<?php } ?>
   
       		<?php responsive_in_header(); // header hook ?>
   
       		<?php if( get_header_image() != '' ) : ?>
   
       			<div id="logo">
       				<a>"><img src="<?php header_image(); ?>" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="<?php bloginfo( 'name' ); ?>"/></a>
       			</div><!-- end of #logo -->
   
       		<?php endif; // header image was removed ?>
   
       		<?php if( !get_header_image() ) : ?>
   
       			<div id="logo">
       				<span class="site-name"><a>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span>
       				<span class="site-description"><?php bloginfo( 'description' ); ?></span>
       			</div><!-- end of #logo -->
   
       		<?php endif; // header image was removed (again) ?>
   
       		<?php get_sidebar( 'top' ); ?>
       		<?php wp_nav_menu( array(
       							   'container'       => 'div',
       							   'container_class' => 'main-nav',
       							   'fallback_cb'     => 'responsive_fallback_menu',
       							   'theme_location'  => 'header-menu'
       						   )
       		);
       		?>
   
       		<?php if( has_nav_menu( 'sub-header-menu', 'responsive' ) ) { ?>
       			<?php wp_nav_menu( array(
       								   'container'      => '',
       								   'menu_class'     => 'sub-header-menu',
       								   'theme_location' => 'sub-header-menu'
       							   )
       			);
       			?>
       		<?php } ?>
   
       		<?php responsive_header_bottom(); // after header content hook ?>
   
       	</div><!-- end of #header -->
       <?php responsive_header_end(); // after header container hook ?>
   
       <?php responsive_wrapper(); // before wrapper container hook ?>
       	<div id="wrapper" class="clearfix">
       <?php responsive_wrapper_top(); // before wrapper content hook ?>
       <?php responsive_in_wrapper(); // wrapper hook ?>
       ```
   
 * look forward to hear from you
 * greeetngs

The topic ‘add custom php to the header.php – to integrate metaslider’ is closed
to new replies.

## Tags

 * [linux](https://wordpress.org/support/topic-tag/linux/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 0 replies
 * 1 participant
 * Last reply from: [say_hello](https://wordpress.org/support/users/say_hello/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/add-custom-php-to-the-headerphp-np/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
