wordpress网站GIT主题,搜索框显示不正常
<divclass="search-expand-inner"><?phpif(git_get_option('git_search_baidu')){?><?phpec...
<div class="search-expand-inner">
<?php if (git_get_option('git_search_baidu')) { ?>
<?php echo git_get_option('git_search_code'); ?></div></div>
<?php }elseif (git_get_option('git_search')&&!git_get_option('git_search_baidu')) { ?>
<form method="get" class="searchform themeform" onsubmit="location.href='/?s=' + encodeURIComponent(this.s.value).replace(/%20/g, '+'); return false;" action="/"><div><input type="ext" class="search" name="s" onblur="if(this.value=='')this.value='<?php
echo git_get_option('git_search_placeholder', '输入内容并回车'); ?>';" onfocus="if(this.value=='<?php
echo git_get_option('git_search_placeholder', '输入内容并回车'); ?>')this.value='';" value="<?php
echo git_get_option('git_search_placeholder', '输入内容并回车'); ?>"></div></form></div></div>
<?php }elseif (!git_get_option('git_search')&&!git_get_option('git_search_baidu')){?>
<form method="get" class="searchform themeform" onsubmit="location.href='<?php
echo home_url('/search/'); ?>' + encodeURIComponent(this.s.value).replace(/%20/g, '+'); return false;" action="/"><div><input type="ext" class="search" name="s" onblur="if(this.value=='')this.value='<?php
echo git_get_option('git_search_placeholder', '输入内容并回车'); ?>';" onfocus="if(this.value=='<?php
echo git_get_option('git_search_placeholder', '输入内容并回车'); ?>')this.value='';" value="<?php
echo git_get_option('git_search_placeholder', '输入内容并回车'); ?>"></div></form></div></div>
这段代码有问题吗?求高手指教,谢谢! 展开
<?php if (git_get_option('git_search_baidu')) { ?>
<?php echo git_get_option('git_search_code'); ?></div></div>
<?php }elseif (git_get_option('git_search')&&!git_get_option('git_search_baidu')) { ?>
<form method="get" class="searchform themeform" onsubmit="location.href='/?s=' + encodeURIComponent(this.s.value).replace(/%20/g, '+'); return false;" action="/"><div><input type="ext" class="search" name="s" onblur="if(this.value=='')this.value='<?php
echo git_get_option('git_search_placeholder', '输入内容并回车'); ?>';" onfocus="if(this.value=='<?php
echo git_get_option('git_search_placeholder', '输入内容并回车'); ?>')this.value='';" value="<?php
echo git_get_option('git_search_placeholder', '输入内容并回车'); ?>"></div></form></div></div>
<?php }elseif (!git_get_option('git_search')&&!git_get_option('git_search_baidu')){?>
<form method="get" class="searchform themeform" onsubmit="location.href='<?php
echo home_url('/search/'); ?>' + encodeURIComponent(this.s.value).replace(/%20/g, '+'); return false;" action="/"><div><input type="ext" class="search" name="s" onblur="if(this.value=='')this.value='<?php
echo git_get_option('git_search_placeholder', '输入内容并回车'); ?>';" onfocus="if(this.value=='<?php
echo git_get_option('git_search_placeholder', '输入内容并回车'); ?>')this.value='';" value="<?php
echo git_get_option('git_search_placeholder', '输入内容并回车'); ?>"></div></form></div></div>
这段代码有问题吗?求高手指教,谢谢! 展开
1个回答
展开全部
先判断下是否登录,然后获取当前用户对象,然后获取当前用户对象的信息,需要哪些用哪些:
if(is_user_logged_in()){
$current_user = wp_get_current_user();
/**
* @example Safe usage: $current_user = wp_get_current_user();
* if ( !($current_user instanceof WP_User) )
* return;
*/
echo 'Username: ' . $current_user->user_login . '<br />';
echo 'User email: ' . $current_user->user_email . '<br />';
echo 'User first name: ' . $current_user->user_firstname . '<br />';
echo 'User last name: ' . $current_user->user_lastname . '<br />';
echo 'User display name: ' . $current_user->display_name . '<br />';
echo 'User ID: ' . $current_user->ID . '<br />';
}
if(is_user_logged_in()){
$current_user = wp_get_current_user();
/**
* @example Safe usage: $current_user = wp_get_current_user();
* if ( !($current_user instanceof WP_User) )
* return;
*/
echo 'Username: ' . $current_user->user_login . '<br />';
echo 'User email: ' . $current_user->user_email . '<br />';
echo 'User first name: ' . $current_user->user_firstname . '<br />';
echo 'User last name: ' . $current_user->user_lastname . '<br />';
echo 'User display name: ' . $current_user->display_name . '<br />';
echo 'User ID: ' . $current_user->ID . '<br />';
}
博思aippt
2024-07-20 广告
2024-07-20 广告
作为深圳市博思云创科技有限公司的工作人员,对于Word文档生成PPT的操作,我们有以下建议:1. 使用另存为功能:在Word中编辑完文档后,点击文件->另存为,选择PowerPoint演示文稿(*.pptx)格式,即可将文档内容转换为PPT...
点击进入详情页
本回答由博思aippt提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询