137
关于使用吊牌的注记
<?php// If this the Posts page, display a message.if ( is_home() ): echo '<h2>Thanks for visiting our blog!</h2>';endif;?>
<?php// If this is the home page, show a special message.if ( is_front_page() ) { ?><h1>Welcome</h1><?php // Otherwise, show the page title.} else { ?><?php the_title( '<h1 class="entry-title">', '</h1>' ); ?><?php } ?>
<?php// Target all posts.if ( is_single() ):echo 'You are on a single post.';endif;// Target all pages.if ( is_page() ): echo 'This is a page';endif; ?>
<?php// Target About Usif ( is_page( 'about-us' ) ): ?><a href="#"></a><?php endif; ?>
<?php// Target About Us and Contact Us pages.if ( is_page( array('about-us', 'contact-us') ) ): ?><a href="#"></a><?php endif; ?>
is_tax()
<?php// Display a message on our Genre archive pages.if (is_tax('genre','rock','hip-hop','jazz') ):echo '<h2>This is a genre archive. Enjoy!</h2>';endif; ?>
has_term()
<?php// Show an image for the Rock genre.if (has_term('rock','genre') ): ?><?php endif; ?>
<?php// Add a search form to the Services page template.if (is_page_template('services.php') ):?><?php get_search_form(); ?><?php endif; ?>
最新文章
2019.10.29
沧州设计网站:免费Web浏览器框架PSD模板
2019.08.19
沧州设计网站:使用PHP创建网站——SaaS网站开发
2019.08.17
沧州网页设计:伟大的图标如何影响用户体验
2019.08.17
沧州网站建设:“从这里开始”页面的网页设计趋势
2019.06.12
沧州建站:关于创建WordPress会员网站的思考
2019.06.12
沧州设计公司:令人兴奋的设计专业拓展你的技能
2019.06.12
沧州高端网站设计:如何向WordPress主题添加条件逻辑
2019.06.12
沧州做网站:12有日出灵感配色的美丽网站
2019.06.12
沧州高端网站制作:使用用户堆栈完善用户体验
2019.06.12
沧州企业网站开发:平衡客户需求与投资组合
随机推荐
2019.06.12
沧州做网站:12有日出灵感配色的美丽网站
2019.06.12
沧州高端网站设计:如何向WordPress主题添加条件逻辑
2019.08.17
沧州网页设计:伟大的图标如何影响用户体验
2019.06.12
沧州企业网站开发:平衡客户需求与投资组合
2019.06.12
沧州高端网站制作:使用用户堆栈完善用户体验
2019.08.17
沧州网站建设:“从这里开始”页面的网页设计趋势
2019.06.12
沧州设计公司:令人兴奋的设计专业拓展你的技能
2019.10.29
沧州设计网站:免费Web浏览器框架PSD模板
2019.08.19
沧州设计网站:使用PHP创建网站——SaaS网站开发
2019.06.12
沧州建站:关于创建WordPress会员网站的思考