我想幫助他的朋友爲他的wordpress。問題是,我幾乎完全不熟悉php的工作原理。我沒有寫這段代碼,但因爲我對html和css有基本的想法,所以我試圖修復它,但仍然沒有成功。
結果是:; 。版權所有©2015 AABB。版權所有。
但我想:版權所有©2015 AABB。版權所有。
如何編寫PHP中的版權?
- 我不知道如何去除「;」。 「。
如果我刪除:
Copyright © <?php echo date("Y")." "; ?> <?php bloginfo('name')." "; ?>. All Rights Reserved.
沒有版權將在頁腳中顯示。
的代碼如下:
<?php
/**
* The template for displaying the footer.
*
* @package WordPress
* @subpackage Perfekto
* @since Perfekto 1.0
*/
?>
</div><!-- end .pad_container -->
<div class="pagination-bg"></div>
<div class="pagination-bottom"></div>
<div id="footer">
<div id="foot-full">
<?php get_sidebar('footerfull');?>
</div><!-- end #footfull -->
<div id="foot-full2">
<?php get_sidebar('footerfull2');?>
</div><!-- end #foot-full2 -->
<div id="foot-col1">
<?php get_sidebar('footer1');?>
</div><!-- end #foot-col1 -->
<div id="foot-col2">
<?php get_sidebar('footer2');?>
</div><!-- end #foot-col2 -->
<div id="foot-col3">
<?php get_sidebar('footer3');?>
</div><!-- end #foot-col3 -->
<div class="clear"></div>
</div><!-- end #footer -->
<div id="footer-copyright">
<div id="copyright">
<?php /* $foot= stripslashes(get_option('templatesquare_footer')) */ ?>
<?php /* if($foot==""){ */?>
<?php /* _e('Copyright', 'templatesquare'); */ ?> <!-- © -->
<?php /* bloginfo('name'); */ ?></a>;
<?php
/*
global $wpdb;
$post_datetimes = $wpdb->get_results("SELECT YEAR(min(post_date_gmt)) AS firstyear, YEAR(max(post_date_gmt)) AS lastyear FROM $wpdb->posts WHERE post_date_gmt > 1970");
if ($post_datetimes) {
$firstpost_year = $post_datetimes[0]->firstyear;
$lastpost_year = $post_datetimes[0]->lastyear;
$copyright = $firstpost_year;
if($firstpost_year != $lastpost_year) {
$copyright .= '-'. $lastpost_year;
}
$copyright .= ' ';
echo '<a href="'.home_url('/').'">'.get_bloginfo('name') .'</a>';
}
*/
?>. <?php /* _e('All rights reserved.', 'templatesquare'); */ ?>
<?php /* }else{ */ ?>
<?php /* echo $foot; */ ?>
<?php /* } */ ?>
Copyright ©
<?php echo date("Y")." "; ?>
<?php bloginfo('name')." "; ?>.
All Rights Reserved.
</div>
<div id="footermenu">
<?php wp_nav_menu(array(
'container' => 'ul',
'menu_class' => '',
'menu_id' => '',
'depth' => 1,
'sort_column' => 'menu_order',
'theme_location' => 'footmenu'
));
?>
</div>
</div><!-- end #footer-copyright -->
</div><!-- end #container -->
</div><!-- end #frame -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-31480559-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script type="text/javascript"> Cufon.now();</script> <!-- to fix cufon problems in IE browser -->
<?php
wp_footer();
?>
<?php $google = stripslashes(get_option('templatesquare_google'));?>
<?php if($google=="false"){?>
<?php }else{?>
<?php echo $google; ?>
<?php } ?>
</body>
</html>
其實這顯示當前的年份 – frhling1