Jump to content


This topic is now archived and is closed to further replies.


Adding Google Translate code to header.php

Recommended Posts


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        http://www.pagelines.com/
  13.  * @link        http://www.pagelines.com/tour
  14.  *
  15.  * @author      PageLines   http://www.pagelines.com/
  16.  * @copyright   Copyright (c) 2008-2012, PageLines  [email protected]
  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 - http://docs.pagelines.com/advanced/hooks


Also, see the WordPress codex - http://codex.wordpress.org/Plugin_API/Action_Reference/wp_head

Please search our forums, before posting!

Share this post

Link to post
Share on other sites

  • Similar Content

    • Paul
      By Paul+
      I was surprised to see I had no menu today - out of the blue - its actually moved to the bottom of the page!  After hours of fiddling and disabling every single plugin, leaving just plagelines the issue is still present.  See video for a basic text box - I moved it into the head and it jumps to the bottom and shows just above the footer but below the main content.  I have a temp fix by placing the menu into the first row on the main content but it does mean other than my home page, all other pages have no menu.  A quick fix is very urgent for this bug.
    • russe-intensif
      By russe-intensif+
      Hi team,
      checking my site today, i'm surprised to see my MegaNav all in bottom of the pages, while it's in header.
      After getting to change it in couple of pages onto Template part (too time consuming !), i'm desperate and ask you for help :-)
      Thank you in advance !

    • flourishdesignstudio
      By flourishdesignstudio+
      I have an older site that was built using PageLines several years ago (prior to the release of DMS). I wanted to leverage some of the power of your new PL5 plugin but the theme prevents be from adding any generated custom sidebars to the theme (through the drag and drop interface) and does not allow me to add any PL5 sections/containers/etc to the header or footer. Is there any way to easily override that or am I stuck only using PL5 in the content areas of the site?
      Thanks so much for the help!
    • JP
      By JP+
      How can you set the translations with platform5, the parts that are not in pages or posts? Texts and images…
    • romanondrasek
      By romanondrasek+
      hi all, I have some trouble using PL5 on my site. 
      I used plugins for event calendar (event on) and plugin (timetable responsive scheduler for WP) for schedule (classes) in the gym.
      The problem is, that post from this 2 plugins are shown without menu in header and footer. (I setup header and footer) in the page editor for all type of page. 
      When I create a lesson, it creates posts with slug (I have a slug "lekce" & event for events).
      I try to edit the post with PL editor, but editor is not opening on the post.

      Do you have some idea where should be some problem? Thanx so much.
      here are links for the sites :
      site with schedule :
      site of one of the class (pilates)
      site with calendar :
      7 side with one event from the calendar :
      when I have my site on DMS2 it was working :-(