@Mr_Ultraz

Как вставить шапку (изображение) в шаблон Wordpress?

Здравствуйте, появилась надобность сделать шапку на сайте! Шаблон называется Preschool and Kindergarten необходимо в обозначенном на скрине месте сделать шапку в виде изображения. Подскажите, пожалуйста, как это реализовать можно? Буду очень благодарен за помощь!
5eab17f94bc03598709440.png
  • Вопрос задан
  • 1101 просмотр
Пригласить эксперта
Ответы на вопрос 4
azerphoenix
@azerphoenix
Java Software Engineer
1) проинспектируйте эту область в консоли браузера
2) откройте файл header.php и вставьте в нужное место изображение.
Для вставки изображения используйте - htmlbook.ru/html/img
Ответ написан
Комментировать
@Lord_Dantes
Вариант 1) Открываете header.php и снизу под шапкой вставляете img со стилями.
Вариант 2) Открываете index.php или главный файл вашей страницы.php и сверху вставляете картинку со стилями.
Ответ написан
Комментировать
@Mr_Ultraz Автор вопроса
В этом шаблоне какой-то странный header.php и index.php

header.php
<?php
/**
 * The header for our theme.
 *
 * This is the template that displays all of the <head> section and everything up until <div id="content">
 *
 * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
 *
 * @package Preschool_and_Kindergarten
 **
 *
     * Doctype Hook
     * 
     * @hooked preschool_and_kindergarten_doctype_cb
    */
    do_action( 'preschool_and_kindergarten_doctype' );
?>

<head itemscope itemtype="http://schema.org/WebSite">

<?php 
    /**
     * Before wp_head
     * 
     * @hooked preschool_and_kindergarten_head
    */
    do_action( 'preschool_and_kindergarten_before_wp_head' );

    wp_head(); 
?>
</head>

<body <?php body_class(); ?> itemscope itemtype="http://schema.org/WebPage">
		
    <?php
    wp_body_open();
    
    /**
    * @hooked preschool_and_kindergarten_page_start 
    */
    do_action( 'preschool_and_kindergarten_before_page_start' ); 
    
    /**
    * preschool_and_kindergarten Header Top
    * 
    * @hooked preschool_and_kindergarten_mobile_navigation_header  - 5
    * @hooked preschool_and_kindergarten_header_start  - 10
    * @hooked preschool_and_kindergarten_header_top    - 20
    * @hooked preschool_and_kindergarten_header_bottom - 30
    * @hooked preschool_and_kindergarten_header_end    - 40    
    */	    
    
    do_action( 'preschool_and_kindergarten_header' ); 
    
    /**
    * After Header
    * 
    * @hooked preschool_and_kindergarten_page_header
    */
    do_action( 'preschool_and_kindergarten_after_header' );


index.php
<?php
/**
 * The main template file.
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package Preschool_and_Kindergarten
 */

get_header(); ?>

	<div id="primary" class="content-area">
		<main id="main" class="site-main" role="main">

		<?php
		if ( have_posts() ) :

			/* Start the Loop */
			while ( have_posts() ) : the_post();

				/*
				 * Include the Post-Format-specific template for the content.
				 * If you want to override this in a child theme, then include a file
				 * called content-___.php (where ___ is the Post Format name) and that will be used instead.
				 */
				get_template_part( 'template-parts/content', get_post_format() );

			endwhile;
           preschool_and_kindergarten_pagination();

		else :

			get_template_part( 'template-parts/content', 'none' );

		endif; ?>

		</main><!-- #main -->
	</div><!-- #primary -->

<?php
get_sidebar();
get_footer();
Ответ написан
Комментировать
Chupizdik
@Chupizdik
Вам нужно внести изменения в файл template-functions.php
Без пациента не могу сказать куда именно (скорее всего в строку 240). И так пришлось тему скачать, чтоб файлы посмотреть (вот оно мне надо?). Давайте ссылку на сайт - подскажу.
Ответ написан
Комментировать
Ваш ответ на вопрос

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

Войти через центр авторизации
Похожие вопросы