Head First WordPress 2

本文介绍如何通过调整CSS规则和HTML结构来定制WordPress Acme主题,使其符合网站布局需求。包括清理不必要的样式规则、修改header.php文件内容及添加页脚等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Now that we know what CSS rules we need,let's get out Acme blog theme looking just like the main site.

Clean out some unnecessary CSS rules.
There are a few rules in the Acme site stylesheet that will cause problems with our blog layout.We need to strip those out so that our blog pages render correctly.

These are the rules that define the way the original header and masthead look.If we don't remove this code,they will conflict with the new rules we added earlier.And ,because they are lower in the file,they will oerride any rule with the same class or ID.

Use the "find" or "search" feature in your text to locate these rules and remove them.Don't worry if you mess up and delete the wrong rules-we copied the original theme so you can just go back to the "twenntyten" folder and re-copy the original style.css.


Clean up the header.php markup

Just as we had to get rid of unused CSS rules---we need to do the same for our makeup.Replace <div id="wrapper" class="hfeed"> and everything below in with the code below.(Make sure you're in header.php and not index.php in the acme theme.w)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Everything is looking good so for,but we need a footer for our site.Below is some content for the footer--insert it into footer.php and create some simple style rules to get it looking presentable.

presentable:像样
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<div id="site-info">
<p><a href="<?php echo home_url('/') ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display') ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>

<p><a title="About Acme" href="#">About Acme</a> | <a title="About Acme" href="#">Our Products</a> | <a title="About Acme" href="#">Contact Us </a></p>

</div>
Finally,we need to add the nav links from the top of the page to the footer.We don't need to copy the whole list structure,just the links we can put them in a <p> tag right below the blog title.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

 

 

 

 

 

 

 

 

 

 

 

 

转载于:https://www.cnblogs.com/sgsheg/archive/2012/11/16/2774126.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值