Jump to content


Photo
- - - - -

Adding Google Translate code to header.php

google translate header php shortcode

Best Answer Danny , 12 August 2014 - 10:32 AM

Hi,

 

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.pageline.../advanced/hooks

 

Also, see the WordPress codex - http://codex.wordpre...ference/wp_head

Go to the full post


  • Please log in to reply
1 reply to this topic

#1 chrisw

chrisw

    Member

  • Members
  • 15 posts
  • Country: Country Flag

Posted 11 August 2014 - 10:00 PM

Hi this is my site:

 

Please Login or Register to see this Hidden Content

 

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        

    Please Login or Register to see this Hidden Content

  13.  * @link        

    Please Login or Register to see this Hidden Content

  14.  *
  15.  * @author      PageLines  

    Please Login or Register to see this Hidden Content

  16.  * @copyright   Copyright © 2008-2012, PageLines  hello@pagelines.com
  17.  *
  18.  * @internal    last revised January 23, 2012
  19.  * @version     ...
  20.  *
  21.  * @todo Define version
  22.  */
  23.  
  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
  30.  
  31.                 wp_head()// Hook (WordPress)
  32.  
  33.                 pagelines_register_hook('pagelines_head_last')// Hook ?>
  34.  
  35. </head>
  36. <?php
  37.  
  38. Please Login or Register to see this Hidden Content

     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
  42.  
  43. if(has_action('override_pagelines_body_output')):
  44.         do_action('override_pagelines_body_output');
  45.  
  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();
  63.  
  64. endif;
  65.  
 


#2 Danny

Danny

    Is Awesome!

  • Moderators
  • 16982 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 12 August 2014 - 10:32 AM   Best Answer

Hi,

 

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 - 

Please Login or Register to see this Hidden Content

 

Also, see the WordPress codex - 

Please Login or Register to see this Hidden Content







Also tagged with one or more of these keywords: google translate, header, php shortcode