Задать вопрос
nastia_roki
@nastia_roki

Как вручную настроить функцию формирования title и метатегов?

По вот этой ссылке вчера настроила 1 сайт. все получилось.

Сегодня настраиваю другой.
Прошла шаг вставки скрипта в файл functions.php

Двигаемся дальше. не могу в файле header.php найти ничего похожего на код <?php wp_title('«', true, 'right'); ?> <?php bloginfo('name'); ?>
Этот код нужен чтобы вручную проставлять title для каждой страницы.

Где можно заменить ссылку на нужную и добавить кусочки кода? (детали в ссылке)

Текст из моего файла:

<?php
/**
* The Header for our theme.
*/

// Theme init - don't remove next row! Load custom options
theleaf_core_init_theme();

$body_scheme = theleaf_get_custom_option('body_scheme');
if (empty($body_scheme) || theleaf_is_inherit_option($body_scheme)) $body_scheme = 'original';
?>
class="<?php echo 'scheme_' . esc_attr($body_scheme); ?>">



<?php
wp_head();
?>

>

<?php
theleaf_profiler_add_point(esc_html__('BODY start', 'theleaf'));

echo force_balance_tags(theleaf_get_custom_option('gtm_code'));

do_action( 'before' );

// Add TOC items 'Home' and "To top"
if (theleaf_get_custom_option('menu_toc_home')=='yes')
echo trim(theleaf_sc_anchor(array(
'id' => "toc_home",
'title' => esc_html__('Home', 'theleaf'),
'description' => esc_html__('{{Return to Home}} - ||navigate to home page of the site', 'theleaf'),
'icon' => "icon-home",
'separator' => "yes",
'url' => esc_url(home_url('/'))
)
));
if (theleaf_get_custom_option('menu_toc_top')=='yes')
echo trim(theleaf_sc_anchor(array(
'id' => "toc_top",
'title' => esc_html__('To Top', 'theleaf'),
'description' => esc_html__('{{Back to top}} - ||scroll to top of the page', 'theleaf'),
'icon' => "icon-double-up",
'separator' => "yes")
));
?>

<?php if ( !theleaf_param_is_off(theleaf_get_custom_option('show_sidebar_outer')) ) { ?>

<?php } ?>

<?php get_template_part(theleaf_get_file_slug('sidebar_outer.php')); ?>

<?php
$class = $style = '';
if (theleaf_get_custom_option('bg_custom')=='yes' && (theleaf_get_custom_option('body_style')=='boxed' || theleaf_get_custom_option('bg_image_load')=='always')) {
if (($img = theleaf_get_custom_option('bg_image_custom')) != '')
$style = 'background: url('.esc_url($img).') ' . str_replace('_', ' ', theleaf_get_custom_option('bg_image_custom_position')) . ' no-repeat fixed;';
else if (($img = theleaf_get_custom_option('bg_pattern_custom')) != '')
$style = 'background: url('.esc_url($img).') 0 0 repeat fixed;';
else if (($img = theleaf_get_custom_option('bg_image')) > 0)
$class = 'bg_image_'.($img);
else if (($img = theleaf_get_custom_option('bg_pattern')) > 0)
$class = 'bg_pattern_'.($img);
if (($img = theleaf_get_custom_option('bg_color')) != '')
$style .= 'background-color: '.($img).';';
}
?>

>

<?php
if (theleaf_get_custom_option('show_video_bg')=='yes' && (theleaf_get_custom_option('video_bg_youtube_code')!='' || theleaf_get_custom_option('video_bg_url')!='')) {
$youtube = theleaf_get_custom_option('video_bg_youtube_code');
$video = theleaf_get_custom_option('video_bg_url');
$overlay = theleaf_get_custom_option('video_bg_overlay')=='yes';
if (!empty($youtube)) {
?>

<?php
} else if (!empty($video)) {
$info = pathinfo($video);
$ext = !empty($info['extension']) ? $info['extension'] : 'src';
?>

<?php
}
}
?>



<?php
$top_panel_style = theleaf_get_custom_option('top_panel_style');
$top_panel_position = theleaf_get_custom_option('top_panel_position');
$top_panel_scheme = theleaf_get_custom_option('top_panel_scheme');
theleaf_profiler_add_point(esc_html__('Before Page Header', 'theleaf'));
// Top panel 'Above' or 'Over'
if (in_array($top_panel_position, array('above', 'over'))) {
theleaf_show_post_layout(array(
'layout' => $top_panel_style,
'position' => $top_panel_position,
'scheme' => $top_panel_scheme
), false);
// Mobile Menu
get_template_part(theleaf_get_file_slug('templates/headers/_parts/header-mobile.php'));

theleaf_profiler_add_point(esc_html__('After show menu', 'theleaf'));
}

// Slider
get_template_part(theleaf_get_file_slug('templates/headers/_parts/slider.php'));

// Top panel 'Below'
if ($top_panel_position == 'below') {
theleaf_show_post_layout(array(
'layout' => $top_panel_style,
'position' => $top_panel_position,
'scheme' => $top_panel_scheme
), false);
// Mobile Menu
get_template_part(theleaf_get_file_slug('templates/headers/_parts/header-mobile.php'));

theleaf_profiler_add_point(esc_html__('After show menu', 'theleaf'));
}

// Top of page section: page title and breadcrumbs
$show_title = theleaf_get_custom_option('show_page_title')=='yes';
$show_navi = $show_title && is_single() && theleaf_is_woocommerce_page();
$show_breadcrumbs = theleaf_get_custom_option('show_breadcrumbs')=='yes';
if ($show_title || $show_breadcrumbs) {
?>



<?php
if ($show_title) {
if ($show_navi) {
?><?php
previous_post_link( '%link', '%title', true, '', 'product_cat' );
next_post_link( '%link', '%title', true, '', 'product_cat' );
?><?php
} else {
?><?php echo strip_tags(theleaf_get_blog_title()); ?><?php
}
}
if ($show_breadcrumbs) {
?><?php if (!is_404()) theleaf_show_breadcrumbs(); ?><?php
}
?>



<?php
}
?>



<?php

// Custom header code

if (!theleaf_param_is_off(theleaf_get_custom_option('header_custom_show'))) {
?>


<?php echo do_shortcode(force_balance_tags(theleaf_get_custom_option('header_custom'))); ?>


<?php
}

theleaf_profiler_add_point(esc_html__('Before Page content', 'theleaf'));
// Content and sidebar wrapper
if (theleaf_get_custom_option('body_style')!='fullscreen') theleaf_open_wrapper('');

// Main content wrapper
theleaf_open_wrapper('');

?>
  • Вопрос задан
  • 132 просмотра
Подписаться 1 Оценить Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы