php - 修改 WordPress header ,但我不确定我正在使用什么主题

标签 php wordpress

尽管我是一名程序员(使用 Python 和 C++),但我还是雇了一个人来制作我的 Wordpress 网站。我不想花很多时间学习Wordpress,而且他有更好的图形设计技能。但是,我现在需要对标题进行一些更改,并且我将尝试自己进行更改以节省资金。

我的第一个困惑是我的主题是如何设置的。我认为我雇用的那个人的主题是基于 Roots 的,但是我在网站上看到的内容与我在网上找到的一些教程中描述的 Roots 似乎有很多差异。我想我应该从在 head.php、header.php、header-top-navbar.php 和 page-header.php 中发布一些代码开始。我的问题是——我需要在哪里进行更改才能向标题添加一些文本? (我想加一句口号——“纯净的声音,感知耳朵”)

我知道这一切可能很复杂,所以如果没有简单的答案,我需要一些指导来了解这里使用的主题,以及如何了解更多有关使用它的信息。那么基本上,这里发生了什么?帮助!

这是 header.php:

<header class="banner" role="banner">
  <div class="container">
    <div class="row">
      <div class="col-xs-12 col-lg-2">
        <h1 class="logo"><a href="<?php echo home_url(); ?>/"><?php bloginfo('name'); ?>">Brilliant Zen Audio</a></h1>
      </div>
      <div class="col-xs-12 col-lg-7 col-lg-offset-3">
        <nav role="navigation" class="clearfix">
          <?php
            if (has_nav_menu('primary_navigation')) :
              wp_nav_menu(array('theme_location' => 'primary_navigation', 'menu_class' => ''));
            endif;
          ?>
        </nav>      
      </div>
    </div>
  </div>
</header>

这是 head.php:

<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" <?php language_attributes(); ?>> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" <?php language_attributes(); ?>> <!--<![endif]-->
<head>
  <meta charset="utf-8">
  <title><?php wp_title('|', true, 'right'); ?></title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <?php wp_head(); ?>

  <link rel="alternate" type="application/rss+xml" title="<?php echo get_bloginfo('name'); ?> Feed" href="<?php echo home_url(); ?>/feed/">
</head>

这是 header-top-navbar.php:

<header class="banner navbar navbar-default navbar-static-top" role="banner">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="<?php echo home_url(); ?>/"><?php bloginfo('name'); ?></a>
    </div>

    <nav class="collapse navbar-collapse" role="navigation">
      <?php
        if (has_nav_menu('primary_navigation')) :
          wp_nav_menu(array('theme_location' => 'primary_navigation', 'menu_class' => 'nav navbar-nav'));
        endif;
      ?>
    </nav>
  </div>
</header>

最后是 page-header.php:

<div class="page-header">
  <h1>
    <?php echo roots_title(); ?>
  </h1>
</div>

编辑:这是来自 front-page.php 的一些代码。我看到 slider 放在哪里了。我想弄清楚的是它如何决定在哪里绘制 slider ,以及棕色矩形的来源。

<div class="row">

<?php putRevSlider( "brilliant-zen" ) ?>

</div>
<div class="container" style="margin-bottom:3em;">
  <div class="row">
    <div class="col-lg-7">
      <h3> Brilliant Zen Audio</h3>
      <p>A Zen master brings all the factors of enlightenment into balance. Brilliant Zen Audio offers a synergistic blend
         of musicality, detail, and dynamics for bringing musical enjoyment into a most pleasureful balance.</p>

    </div>
    <div class="col-lg-5">
      <h3>Musicality, Detail, and Dynamics</h3>
      <p>Brilliant Zen Audio is dedicated to providing equipment that excels in musical engagement and beauty, while providing high resolution at the same time.</p><br/>
      <a href="contact" class="btn btn-lg btn-orange">Contact Us</a>

    </div>
  </div>
</div>

最佳答案

roots主题按此顺序加载模板(请参阅base.php):

  1. head.php
  2. header-top-navbar.php 如果在 config.php 中启用了 Bootstrap 的导航栏,否则加载 header.php
  3. page-header.php,仅在查看页面时调用 (page.php)

我不确定您是否启用了 Bootstrap 导航栏,所以我最好的猜测是更改 header.php:

<header class="banner" role="banner">
  <div class="container">
    <div class="row">
      <div class="col-xs-12 col-lg-2">
        <h1 class="logo"><a href="<?php echo home_url(); ?>/"><?php bloginfo('name'); ?>">Brilliant Zen Audio</a></h1>
        <p>"Pure Sound for Perceptive Ears"</p>
      </div>
      <div class="col-xs-12 col-lg-7 col-lg-offset-3">
        <nav role="navigation" class="clearfix">
          <?php
            if (has_nav_menu('primary_navigation')) :
              wp_nav_menu(array('theme_location' => 'primary_navigation', 'menu_class' => ''));
            endif;
          ?>
        </nav>      
      </div>
    </div>
  </div>
</header>

在这里,我在 Logo 正下方添加了您的口号(第 6 行)。 HTH

关于php - 修改 WordPress header ,但我不确定我正在使用什么主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19444122/

相关文章:

php:何时使用 echo 和 return

php - 从 Drupal 8 的链接字段中提取 Url 和标题?

mysql - query_cache_type : enable or disable?

wordpress - 如何将wordpress的登录表单添加到您的页面中?

wordpress - 重定向到 Woocommerce 中的外部 URL 并添加 rel ="nofollow"

javascript - 如何自定义或移动核心文件?

php - 按 JSON 数组对 SQL 数据进行分组

php - 无法实现两个具有相同方法名称的接口(interface)

php - 输入类型 ="file"更改后是否可以重新加载表单?

php - Wordpress 插件处于事件状态但未在管理工具中检查