0
Welcome Guest! Login
0 items Join Now

how to include custom php in <head> of template

    • Igors's Avatar
    • Igors
    • Sr. Rocketeer
    • Posts: 119
    • Thanks: 0
    • SEO Pakalpojumi

    how to include custom php in <head> of template

    Posted 11 years 9 months ago
    • Who?'s Avatar
    • Who?
    • Preeminent Rocketeer
    • Posts: 25562
    • Thanks: 613
    • Joomla freelancer

    Re: how to include custom php in <head> of template

    Posted 11 years 9 months ago
    • Edit index.php file of your template and add it there
    • Check my services at: Mihha-Vision
    • Igors's Avatar
    • Igors
    • Sr. Rocketeer
    • Posts: 119
    • Thanks: 0
    • SEO Pakalpojumi

    Re: how to include custom php in <head> of template

    Posted 11 years 9 months ago
    • Who?'s Avatar
    • Who?
    • Preeminent Rocketeer
    • Posts: 25562
    • Thanks: 613
    • Joomla freelancer

    Re: how to include custom php in <head> of template

    Posted 11 years 9 months ago
    • Please post here beginning of that index.php so I can see the code
    • Check my services at: Mihha-Vision
    • Igors's Avatar
    • Igors
    • Sr. Rocketeer
    • Posts: 119
    • Thanks: 0
    • SEO Pakalpojumi

    Re: how to include custom php in <head> of template

    Posted 11 years 9 months ago
    • What i try to do is include in template canonical tag described here http://www.concept-br.de/blog/canonical-tag-for-joomla/
      I should include this
      <?php include(“canonical_tag.php”) ?>
      in head section below
      <jdoc:include type=”head” />“
      but it wont work. And i put attached file in main template directory.
      I have in website with 3 languages and main language (LV) without language tag, Google and seo mooz indexes both dublicate content so i should find possibility to insert canononical tag.
      <?php
      /**
       * @package    Clarion Template - RocketTheme
       * @version    1.4 October 9, 2012
       * @author     RocketTheme http://www.rockettheme.com
       * @copyright  Copyright (C) 2007 - 2012 RocketTheme, LLC
       * @license    http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
       *
       * Gantry uses the Joomla Framework (http://www.joomla.org), a GNU/GPLv2 content management system
       *
       */
      // no direct access
      defined( '_JEXEC' ) or die( 'Restricted index access' );
       
      // load and inititialize gantry class
      require_once('lib/gantry/gantry.php');
      $gantry->init();
       
      function isBrowserCapable(){
          global $gantry;
          
          $browser = $gantry->browser;
          
          // ie.
          if ($browser->name == 'ie' && $browser->version < 8) return false;
          
          return true;
      }
      // get the current preset
      $gpreset = str_replace(' ','',strtolower($gantry->get('name')));
       
      ?>
      <!DOCTYPE html>
      <!-- Microdata markup added by Google Structured Data Markup Helper. -->
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $gantry->language; ?>" lang="<?php echo $gantry->language;?>" >
      <head>
          <?php 
              $gantry->displayHead();
              $gantry->addStyles(array('template.css','joomla.css'));
              
              if ($gantry->browser->platform != 'iphone')
                  $gantry->addInlineScript('window.addEvent("domready", function(){ new SmoothScroll(); });');
                  
              if ($gantry->get('loadtransition') && isBrowserCapable()){
                  $gantry->addScript('load-transition.js');
                  $hidden = ' class="rt-hidden"';
              } else {
                  $hidden = '';
              }
              
          ?>
      </head>
    • seos.lv/pakalpojumi/seo-optimizacija SEO Pakalpojumi

Time to create page: 0.083 seconds