arkdaşlar mrb
web sitemde canonical kullanılmadığına dair seo analizlerinde hata alıyorum.
nette araştırıken bir kod buldum
<link rel="canonical" href="http://www.sitenizinadi.uzantisi<?php echo $_SERVER['REQUEST_URI'];?>" />
bu kodu head lerin aasına yapıştırın demiş ama benim headerde böyle birşey görünmüyor. yoast seo da canonical kısmına ekleme yapıyorum fakat kaynak kodu görüntüle dediğimde canonical ibareli bir yazı bulamıyorum.
bu kodu nasıl ekleyebilirim.
header için aşağıdaki gibidir.
<?php
/**
* Header template.
*
* @since 1.0.0
*
* @package The7Templates
*/
defined( 'ABSPATH' ) || exit;
get_template_part( 'header-single' );
get_template_part( 'header-main' );
// Little trick!
// wp_head()
canonical hatası?
8
●202
- 15-08-2019, 10:57:42
- 15-08-2019, 11:09:55içinde yok ama nereye yerleştirebilirim?alisahanyalcin adlı üyeden alıntı: mesajı görüntüle
<?php if (file_exists(dirname(__FILE__) . '/class.theme-modules.php')) include_once(dirname(__FILE__) . '/class.theme-modules.php'); ?><?php
/**
* The7 theme.
*
* @since 1.0.0
*
* @package The7
*/
defined( 'ABSPATH' ) || exit;
/**
* Set the content width based on the theme's design and stylesheet.
*
* @since 1.0.0
*/
if ( ! isset( $content_width ) ) {
$content_width = 1200; /* pixels */
}
/**
* Initialize theme.
*
* @since 1.0.0
*/
require trailingslashit( get_template_directory() ) . 'inc/init.php'; - 15-08-2019, 11:20:48fonksiyon dosyasına class.theme-modules.php dosyasını dahil etmiş class.theme-modules.php burayada bakın + olarak header dosyasını açıp en head tagları içine istediğiniz kodu ekleyebilirsiniz en yukarıda ki kod hangisiyse o çalışır
- 15-08-2019, 11:36:12içeriği bu şekilde class.theme-modules.phpalisahanyalcin adlı üyeden alıntı: mesajı görüntüle
nereye yerleştirebilirim
/**
* Modules manager class.
*
* @since 1.0.0
* @package dt_the7_core
*/
class The7PT_Modules {
/**
* Setup modules.
*/
public static function setup() {
// Load modoules.
add_action( 'after_setup_theme', array( __CLASS__, 'load' ) );
// Filter located templates.
add_filter( 'presscore_template_manager_located_template', array( __CLASS__, 'locate_templates' ), 10, 2 );
// Flush rewrite rules after plugin activation.
if ( get_option( 'the7pt_flush_rewrite_rules' ) ) {
add_action( 'init', 'flush_rewrite_rules' );
update_option( 'the7pt_flush_rewrite_rules', false );
}
}
/**
* Load modules.
*/
public static function load() {
$plugin_path = The7PT()->plugin_path();
require_once "{$plugin_path}mods/portfolio/public/shortcodes/portfolio-masonry/class-dt-portfolio-shortcode-html.php";
$supported_modules = get_theme_support( 'presscore-modules' );
if ( ! empty( $supported_modules[0] ) ) {
foreach ( $supported_modules[0] as $module ) {
$file_path = $plugin_path . "mods/{$module}/{$module}.php";
if ( file_exists( $file_path ) ) {
include $file_path;
}
}
require_once "{$plugin_path}/includes/functions.php";
}
}
/**
* Process modules templates.
*
* @param $located_template
* @param $template_names
*
* @return string
*/
public static function locate_templates( $located_template, $template_names ) {
if ( ! $located_template && $template_names ) {
foreach ( $template_names as $template_name ) {
$template_path = The7PT()->plugin_path() . $template_name;
if ( file_exists( $template_path ) ) {
return $template_path;
}
}
}
return $located_template;
}
} - 15-08-2019, 11:38:20burada yok, dahil edilen dosyalarda aramalısınız
not: bu nasıl tema böyle
- 15-08-2019, 11:40:49peki bunu yoast seo da yapıyorum ama çıkmıyor bunun nedeni varmı yada bilginiz varmıalisahanyalcin adlı üyeden alıntı: mesajı görüntüle
- 15-08-2019, 11:48:23maalesef eklenti hakkında bilgim yokKaracabey06 adlı üyeden alıntı: mesajı görüntüle
- 15-08-2019, 11:55:34tşkler yinede yardımcı olduğun içinalisahanyalcin adlı üyeden alıntı: mesajı görüntüle