在现有菜单

时间:2016-01-03 15:41:25

标签: wordpress menu

从我之前的帖子开始,关于在我的菜单栏中心创建登录字段表单: Login/Logout field in menu bar is out of place and not functioning (Wordpress)

这是我的header.php(主题股票)

    <!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<?php global $smof_data; ?>
<html <?php language_attributes(); ?> <?php if($smof_data['rnr_enable_rtl_layout'] == true) { echo 'dir="rtl"'; } ?>> <!--<![endif]-->
<!--
===========================================================================
 Jarvis Onepage Parallax WordPress Theme by rocknrolladesigns.com (http://www.rocknrolladesigns.com) 
===========================================================================
-->
<head>
<meta http-equiv="Content-type" content="text/html; charset=<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="x-ua-compatible" content="IE=edge" />
<!-- PAGE TITLE -->

<?php if (defined('WPSEO_VERSION')) { ?>
           <title><?php wp_title(); ?></title>   
<?php }else {
          $rnr_description =  get_bloginfo('description'); ?>
          <title><?php wp_title(' &raquo; ', true, 'right'); ?><?php bloginfo('name'); ?> &raquo; <?php echo $rnr_description; ?></title>
         <meta name="description" content="<?php  echo $rnr_description; ?>">  
         <?php    } ?>
</title>





<!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->



<!-- Mobile Specific Metas & Favicons
========================================================= -->

<?php if($smof_data['rnr_favicon_url'] != "") { ?><link rel="shortcut icon" href="<?php echo $smof_data['rnr_favicon_url']; ?>"><?php } ?>


<!-- WordPress Stuff
========================================================= -->
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    <!-- Google Web Fonts -->

 <?php get_template_part( 'includes/googlefonts'); ?>

<?php wp_head(); ?>

</head>

<body <?php body_class('onepage'); ?> data-spy="scroll" data-target=".navigation" data-offset="82">
<div id="load"></div>



     <!-- START PAGE WRAP -->    
    <div class="page-wrap <?php if($smof_data['rnr_enable_dark_skin'] == true) { echo 'dark-skin'; } ?>">

  <!-- HEADER SECTION -->

1 个答案:

答案 0 :(得分:0)

答案不在您的头文件中,或者至少不在您粘贴的部分。检查html时,顶部导航栏包含在标识为<nav>的div中的undefined-sticky-wrapper中。您需要在此<nav>内输入您的登录表单,然后使用css将其置于中心位置。

<!-- START NAVIGATION -->
<div style="height: 81px;" class="main-menu-wrapper" id="undefined-sticky-wrapper"><nav class="page_scroll navigation dark sticky-nav"><!-- START CONTAINER --><div class="container clearfix">         
          <div class="four columns">            
              <!-- START LOGO -->   
              <div class="logo large">
                                        <a href="#" class="back-to-top"><img src="https://cypherbeats.com/wp-content/uploads/2015/12/cypherlogooffwhitec3.png" alt="Cypher | Music Production Company"></a>
                                  </div>
              <!-- END LOGO --> 
              <div class="wpml-mobile">

               </div>       
          </div><!-- END FOUR COLUMNS -->                

           <!-- BEGIN NAVIGATION SECTION --> 
          <div class="twelve columns">                  
              <!-- START NAVIGATION MENU ITEMS -->

              <ul id="nav" class="main-menu large nav sf-menu sf-js-enabled"><li id="menu-item-251" class="menu-item menu-item-type-post_type menu-item-object-page"><a href="#home"><span>Home</span></a></li><li id="menu-item-369" class="menu-item menu-item-type-post_type menu-item-object-page active"><a href="#blog-section"><span>Blog</span></a></li><li id="menu-item-604" class="menu-item menu-item-type-post_type menu-item-object-page"><a href="#info"><span>INFO</span></a></li><li id="menu-item-347" class="menu-item menu-item-type-post_type menu-item-object-page"><a href="#submit"><span>Submit</span></a></li><li id="menu-item-275" class="menu-item menu-item-type-post_type menu-item-object-page"><a href="#contact"><span>Support</span></a></li></ul><select class="selectnav" id="selectnav1"><option value="https://cypherbeats.com/#home">Home</option><option value="https://cypherbeats.com/#blog-section">Blog</option><option value="https://cypherbeats.com/#info">INFO</option><option value="https://cypherbeats.com/#submit">Submit</option><option value="https://cypherbeats.com/#contact">Support</option></select><!-- END NAVIGATION MENU ITEMS --><div class="wpml-desktop">

               </div>           
          </div><!-- END TWELVE COLUMNS --> 
      </div><!-- END CONTAINER -->  
    </nav></div>
<!-- END NAVIGATION -->

所以你的第一份工作是找出代码中输出这些div的位置,并找到一个可用于挂钩自己代码的过滤器或操作。或者,如果html是由模板输出的,您可以覆盖并修改它。