感谢您花时间阅读此内容。我的标题几乎总结了我遇到的问题。通常我会通过这些类型的东西摸索我的方式,但最终会以错误的方式完成,因此我的网站最终会遇到问题。我正在尝试学习正确的方式来编码所有内容,并让它变得更好,更干净。在主菜单下的标题中添加徽标
这是我使用的WordPress模板。这是一个链接到我的site。我已经设置了一个儿童主题,并且像大多数目前看起来一样,除了我想在“菜单 - 主”下的所有页面上放置网站标志,因为它是在标题中调用。在页面的左上角是我的网站标题和我的网站标语或任何你称之为的地方。下面是我的菜单(menu-primary),所有提到的内容都属于标题。我的模板不允许我在设置或自定义中的标题中插入徽标。我想在菜单部分正下方的页面中间插入一个站点徽标。我想我应该可以点击我的主页或其他东西,并确保它是一个有效的XHTML clickable header image?我不确定这是不是一个好主意,或者没有看到网站标题会链接回主页。有两个链接到我的所有网页上的同一个地方是不好的?我假设如此。我并不需要这个图片来链接我的猜测。
有没有人可以帮助我呢?我很欣赏所有的输入。这个网站对教我的基础知识非常有帮助。我看到了在这里做我想做的事的方法,但我担心它们都不是正确的做法。再次感谢!
这里是header.php文件:
<?php
/**
* Header Template
*
* The header template is generally used on every page of your site. Nearly all other templates call it
* somewhere near the top of the file. It is used mostly as an opening wrapper, which is closed with the
* footer.php file. It also executes key functions needed by the theme, child themes, and plugins.
*
* @package Save for Web
* @subpackage Template
*/
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php hybrid_document_title(); ?></title>
<link rel="stylesheet" href="<?php echo get_stylesheet_uri(); ?>" type="text/css" media="all" />
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php wp_head(); // wp_head ?>
</head>
<body class="<?php hybrid_body_class(); ?>">
<?php do_atomic('open_body'); // saveforweb_open_body ?>
<div id="container">
<?php do_atomic('before_header'); // saveforweb_before_header ?>
<div id="header">
<div class="fixed">
<?php do_atomic('open_header'); // saveforweb_open_header ?>
<div class="wrap">
<div id="branding">
<?php hybrid_site_title(); ?>
<?php hybrid_site_description(); ?>
</div><!-- #branding -->
<?php get_template_part('menu', 'primary'); // Loads the menu-primary.php template. ?>
<?php get_sidebar('header'); // Loads the sidebar-header.php template. ?>
<?php do_atomic('header'); // saveforweb_header ?>
</div><!-- .wrap -->
<?php do_atomic('close_header'); // saveforweb_close_header ?>
</div><!-- .fixed -->
</div><!-- #header -->
<?php do_atomic('after_header'); // saveforweb_after_header ?>
<?php do_atomic('before_main'); // saveforweb_before_main ?>
<div id="main">
<div class="wrap">
<?php do_atomic('open_main'); // saveforweb_open_main ?>
这里是菜单primary.php:
<?php
/**
* Primary Menu Template
*
* Displays the Primary Menu if it has active menu items.
*
* @package Save for Web
* @subpackage Template
*/
if (has_nav_menu('primary')) : ?>
<?php do_atomic('before_menu_primary'); // saveforweb_before_menu_primary ?>
<div id="menu-primary" class="menu-container">
<?php do_atomic('open_menu_primary'); // saveforweb_open_menu_primary ?>
<?php wp_nav_menu(array('theme_location' => 'primary', 'container_class' => 'menu', 'menu_class' => '', 'menu_id' => 'menu-primary-items', 'fallback_cb' => '')); ?>
<?php do_atomic('close_menu_primary'); // saveforweb_close_menu_primary ?>
</div><!-- #menu-primary .menu-container -->
<?php do_atomic('after_menu_primary'); // saveforweb_after_menu_primary ?>
<?php endif; ?>
我们很难回答你的问题,而不知道这个主题是如何放在一起的。您可能需要编辑具有该菜单代码的任何模板文件,然后将徽标添加到该文件的末尾。它不应该很难,但除非我们有更多的信息,否则我不认为这是我们可以帮助你的东西。 –
我试图描述如何做@ChrisHerbert推荐的东西。我想说我不确定你可以给我们什么其他信息。我认为你的问题甚至可以更简洁。但是,由于我们没有模板,所以我们不能告诉你怎么做,这是问题的本质。 –
感谢大家的回复!克里斯,什么样的额外信息会有帮助?我做了一个包括header.php的编辑,希望这有助于。 – bc05