在现有菜单中添加用户登录字段表单 [英] Add user login fields form in existing menu
问题描述
关于我在菜单栏中央创建登录字段表单的内容,从我的前一篇文章继续: 登录/注销字段菜单栏中的位置不正确且无法正常运行(Wordpress)
Continued from my previous post in regards to creating a login field form into the center of my menu bar: Login/Logout field in menu bar is out of place and not functioning (Wordpress)
这是我的header.php(主题股票)
Here is my header.php (Stock from theme)
<!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(' » ', true, 'right'); ?><?php bloginfo('name'); ?> » <?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 -->
推荐答案
答案不在您的头文件中,或者至少不在您粘贴的部分中.检查html,顶部导航栏包含在ID为undefined-sticky-wrapper
的div中包含的<nav>
中.您需要在此<nav>
中生成您的登录表单输出,然后使用css将其放置在中间.
The answers are not located in your header file, or at least not the section you've pasted. Inspecting the html, the top nav bar is contained in a <nav>
contained in a div with id undefined-sticky-wrapper
. You need to make your login form output within this <nav>
then use css to position it in the center.
<!-- 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是由模板输出的,则可以覆盖和修改它.
So your first job is to find out where in the code these divs are output and find a filter or action you can use to hook in your own code. Or if the html is output by a template you can overwrite and modify it.
这篇关于在现有菜单中添加用户登录字段表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!