我真的很掙扎(作爲一個PHP新手)來整理這段代碼並讓它工作(在wordpress語句中的語句)。希望你應該能明白我想要從代碼做我有如下:Tidyup PHP如果其他功能
感謝您的幫助......
<?php
/**
* The template for displaying Author archive pages
*
* @link http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Thirteen
* @since Twenty Thirteen 1.0
*/
get_header();
//phpinfo();
?>
<div class="slider non-home">
<div class="homebanner">
<div class="home royalSlider">
<div class="rsImg"></div>
</div>
</div>
</div>
<div class="main" style="margin-top:20px;">
<div class="hundred">
<div class="page-header">
<?php $userID = intval($author);
if(isset($_GET['author_name'])) :
$curauth = get_userdatabylogin($author_name);
else :
$curauth = get_userdata(intval($author));
endif; ?>
<ul class="profile-list">
<?php
if ($curauth->_mgm_user_status; > 'expired') {
echo "
<li><strong>Status:</strong> <?php echo $curauth->_mgm_user_status; ?></li>
<li><strong>Member No.:</strong> <?php echo $curauth->_mgm_cf_membership_id; ?></li>
<li><strong>Title:</strong> <?php echo $curauth->_mgm_cf_title; ?></li>
<li><strong>First Name:</strong> <?php echo $curauth->first_name; ?></li>
<li><strong>Surname:</strong> <?php echo $curauth->last_name; ?></li>
</ul>
";
} else {
echo "Sorry, this user has expired";
}
?>
</div>
<div class="col13">
<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar("page_sidebar")) : ?>
<?php endif; ?>
</div>
</div>
<?php get_footer(); ?>
這一切都回聲併產生在前端的數據,但我只是無法得到這一切只顯示如果$ curauth - > _ mgm_user_status位等於'過期'。
您在'<?php' – HddnTHA 2014-09-18 19:55:17
裏面使用'<?php'除此之外,是否有任何問題或者下面的解決方案對我有幫助?儘管感謝您的幫助。 – dmt 2014-09-18 20:13:30