-
AuthorPosts
-
February 27, 2015 at 4:28 am #216494
Hi
We were just wondering how we get to the Canonical tag in the theme as our seo expert needs to make some adjustments,
we are using child theme –
X – Child Theme: Integrity Lightwe also need to add a canonical tag to the home page – what template do we edit for this.
Many Thanks
TimFebruary 27, 2015 at 4:53 pm #216890Hi Tim,
Thanks for writing in! Regretfully this isn’t a feature offered by X. It could be possible with custom development, but this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.
Thanks for understanding. Take care!
March 2, 2015 at 3:16 am #218199Hi Thanks for your reply.
I just needed to know which file I need to get my developer to customise in the theme folder. Is the correct file to add the custom code to the – /wp-includes/link-template.php and can this be then included in my child theme folder?
Many Thanks
TimMarch 2, 2015 at 7:39 am #218377Hi Tim,
Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Then navigate to your child theme’s /framework/views/global directory create a file named _header.php and paste the code below:<?php // ============================================================================= // VIEWS/GLOBAL/_HEADER.PHP // ----------------------------------------------------------------------------- // Declares the DOCTYPE for the site and include the <head>. // ============================================================================= ?> <!DOCTYPE html> <!--[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(''); ?></title> <link rel="profile" href="http://gmpg.org/xfn/11"> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>"> <link rel="canonical" href="http://blog.example.com/dresses/green-dresses-are-awesome" /> <?php wp_head(); ?> </head> <body <?php body_class(); ?>> <?php do_action( 'x_before_site_begin' ); ?> <div id="top" class="site"> <?php do_action( 'x_after_site_begin' ); ?>
You can replace the link http://blog.example.com/dresses/green-dresses-are-awesome by your new link.
Hope it helps. -
AuthorPosts