Jump to content
  • 0

Создание кнопки "главная" в меню если на главной странице отображать "Ваши последние записи"


SergeyAQE486
 Share

Question

Подскажите пожалуйста как создать кнопку "главная" в меню, вот этот сайт bt62rzn.ru Команда
<li><a href="<?php bloginfo( 'name' );  ?>/">Главная</a></li> 
создаёт эту кнопку но отображает её некорректное и не делает ссылку на сам сайт. Подскажите пожалуйста как исправить данную ситуацию... Вот файл header php. :

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

?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head <?php do_action( 'add_head_attributes' ); ?>>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">

<?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>
<div id="page" class="site">
    <a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'kickstart-business' ); ?></a>

    <header id="masthead" class="site-header" role="banner">
    <div class="grid">
        <div class="site-branding col-3-12">
        <?php kickstart_business_the_custom_logo(); ?>

                    
                    <h1 class="site-title">
                        <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
                    </h1>
                    <?php
                    $description = get_bloginfo( 'description', 'display' );
                    if ( $description || is_customize_preview() ) : ?>
                        <p class="site-description"><?php echo $description; ?></p>
                    <?php endif; ?>
        </div><!-- .site-branding -->

        <div class="address col-8-12 no-mobile">
            <ul class="header-info">
                <?php if ( get_theme_mod( 'timing' ) ) : ?>
                <li class="header-meta timing col-4-12">
                <b><?php echo get_theme_mod('timing'); ?></b>
                <span><?php echo get_theme_mod('days'); ?></span>
                </li>
                <?php endif; ?>

                <?php if ( get_theme_mod( 'address' ) ) : ?>
                <li class="header-meta location col-4-12">
                <b><?php echo get_theme_mod('address'); ?></b>
                <span><?php echo get_theme_mod('address2'); ?></span>
                </li>
                <?php endif; ?>

                <?php if ( get_theme_mod( 'telephone' ) ) : ?>

                <li class="header-meta tel col-4-12">
                <b><?php echo get_theme_mod('telephone'); ?></b>
                <span><?php echo get_theme_mod('email'); ?></span>
                </li>

                <?php endif; ?>

            </ul>
        </div>
    </div> <!-- End top header -->

        <nav id="site-navigation" class="main-navigation" role="navigation">
        <div class="grid">

        <?php    if (  has_nav_menu( 'primary' ) ) {
         wp_nav_menu(array(
        'menu' => 'Main Navigation',
        'container_id' => 'cssmenu',
        'theme_location' => 'primary',
        'walker' => new Consulting_Menu_Walker()
        ));    }?>
        </div>
        </nav><!-- #site-navigation -->
    </header><!-- #masthead -->

    <div id="content" class="site-content">

    <?php get_template_part('sections/custom-header'); ?>

Edited by SergeyAQE486
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy