Sign in to follow this  
Followers 0

Adding Google Translate code to header.php

2 posts in this topic

Hi this is my site:


I am trying to install Google Translate to the header


The shortcode is:


<?php echo do_shortcode('[google-translator]'); ?>


I know I have to add this to the header.php file but I am not sure where


My code is currently:


  1. <?php
  2. /**
  3.  * HEADER
  4.  *
  5.  * This file controls the HTML <head> and top graphical markup (including
  6.  * Navigation) for each page in your theme. You can control what shows up where
  7.  * using WordPress and PageLines PHP conditionals.
  8.  *
  9.  * @package     PageLines Framework
  10.  * @since       1.0
  11.  *
  12.  * @link
  13.  * @link
  14.  *
  15.  * @author      PageLines
  16.  * @copyright   Copyright (c) 2008-2012, PageLines
  17.  *
  18.  * @internal    last revised January 23, 2012
  19.  * @version     ...
  20.  *
  21.  * @todo Define version
  22.  */
  24. pagelines_register_hook('pagelines_before_html')// Hook
  25. ?><!DOCTYPE html>
  26. <html <?php language_attributes(); ?>>
  27. <head>
  28. <?php
  29.                 pagelines_register_hook('pagelines_head')// Hook
  31.                 wp_head()// Hook (WordPress)
  33.                 pagelines_register_hook('pagelines_head_last')// Hook ?>
  35. </head>
  36. <?php
  38. echo pl_source_comment('Start >> HTML Body'1)?>
  39. <body <?php body_class( pagelines_body_classes() ); ?>>
  40. <?php
  41. pagelines_register_hook('pagelines_before_site')// Hook
  43. if(has_action('override_pagelines_body_output')):
  44.         do_action('override_pagelines_body_output');
  46. else:  ?>
  47. <div id="site" class="<?php echo pagelines_layout_mode();?>">
  48. <?php pagelines_register_hook('pagelines_before_page')// Hook ?>
  49.         <div id="page" class="thepage">
  50.                 <?php pagelines_register_hook('pagelines_page')// Hook ?>
  51.                 <div class="page-canvas">
  52.                         <?php pagelines_register_hook('pagelines_before_header');?>
  53.                         <header id="header" class="container-group">
  54.                                 <div class="outline">
  55.                                         <?php pagelines_template_area('pagelines_header''header')// Hook ?>
  56.                                 </div>
  57.                         </header>
  58.                         <?php pagelines_register_hook('pagelines_before_main')// Hook ?>
  59.                         <div id="page-main" class="container-group">
  60.                                 <div id="dynamic-content" class="outline">
  61. <?php
  62.                                 pagelines_special_content_wrap_top();
  64. endif;

Share this post

Link to post
Share on other sites



You should not edit core files, it is not recommend nor is it something we support. If you want to add something to your sites header area, you will need to use a hook. For more information on hooks see our documentation here -


Also, see the WordPress codex -

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • Remove or reduce margin (or padding) in header
      By richardjacruz+
      I'm building a site at:
      and I followed the instructions on building a "branding" area in the header:
      But, if you see the image I've attached, you'll see that there's a lot of space between the nav and the slider. Is this something I need to control with CSS in the Custom code section, or is there something else I can do that's part of the header section?

      Actually, what would also be nice is if I could put a divider line there... like an orange or a light gray.
    • Header formatting
      By richardjacruz+
      I saw this website build with PageLines DMS:
      I want to have a header that's VERY similar. However, with the fixed area, I'm struggling with how to do that. 
      I want to have a "super menu" under one of the tabs, and drop downs for others, a larger logo to the left like this, a search all the way to the right, and a call-to-action at the top like we see with "Donate" (I want "Request a Quote").
      What area (fixed or header) is best to use for this, and, within that area, what are the best sections to place?
    • Missing Header Region HELP!!!
      By 21thirteen
      We're using DMS2 to create the site
      The latest versions of DMS2 and WP are installed.
      We cloned the site using ManageWP and worked on it on our development server online, then cloned it back to (We've done this before with no problem).
      The Header region is now missing.
      Strangely enough, it can be seen in Chrome if you are logged in to wp-admin, both in preview mode and not, but if you log out, or look at the site in any other browser, the Header region is missing (it has a Media Box in it with links to the Chinese and Japanese versions of the site).
      Even more strange, I decided to try to disable and then re-enable the Header region in Site Settings/Advanced. The Header region was not disabled. I checked the disable box and refreshed the page, then when i tried to uncheck it, every time I refreshed it would be checked again. I finally managed to uncheck it after 6 or 8 tries. The same thing is going on with the Enable Debug checkbox. I checked it and I can't uncheck it now, but when I click on the "Click here" link for Debug Info, it says "WordPress Debug Disabled".
      I've attached screenshots.
      The client is understandably upset. Help would be GREATLY appreciated!
      Thank you,
      Perry Yeldham
      21Thirteen Design

    • Padding on Header image
      By natalielue
      HI All.
      I want to remove the padding on the header image, so that my full width header (1200Px) is sitting left aligned propely rather than with padding. I can't work out where this is styled. Can someone please advise.
      Thank you x
    • Fixed Header
      By cipher
      Can anyone help I am creating a template for our website possible i would like the items at the top half of the page to be fixed??
      I am using DMS2 is this possible?