2012年5月30日 星期三
CSS選取最後一個物件
CSS 最後一個通常不想margin怎麼辦 又不想JQUERY,如果是CSS的話,可以唷!
<html>
<head>
<style type="text/css">
ul li:last-child
{
font-weight:bold
}
</style>
</head>
<body>
<ul>
<li>IE</li>
<li>Firefox</li>
<li>Safari</li>
</ul>
</body>
</html>
2012年5月23日 星期三
2012年5月16日 星期三
wordpress連續兩個query_post
要先new一個WP_Query出來使用
以下範例
<?php
// 僅顯示標籤帶有cooking的文章
$videoQuery = new WP_Query( 'tag=video' );
?>
<?php
$args = array(
'category_name' => 'frash_news');
query_posts($args);
?>
<?php while ($videoQuery->have_posts()) : $videoQuery->the_post(); ?>
//這裡使用吧!!!!
<?php endwhile; ?>
2012年5月15日 星期二
wordpress上使用jquery.masonry
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery-1.7.1.min.js"></script>
<?php wp_head(); ?>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery.masonry.min.js"></script>
注意
jquery主體要在最上面
中間要是wp_head()
下方才能載入jquery.masonry.min.js
$(function(){
$('#news_container').masonry({
// options
itemSelector : '.news_col',
columnWidth : 295
});
});
295是news_col這物件的寬+左右padding+左右margin
.news_col{
float:left;
background:#EFEFEF;
margin-bottom:15px;
margin-left:15px;
padding-left:10px;
padding-right:10px;
width:auto;
width:260px;
在wordpress裡的list(Category)頁就是category.php
archive.php : Archive/Category模板
這就是所謂的list頁面
只要存在這頁wordpress一吃到類似這種網址http://localhost/theme/category/分類名稱/
就會進入Category(category.php)
index.php (首頁)
category.php (分類頁面)
archive.php (彙整頁面)
search.php (搜尋結果頁面)
這就是所謂的list頁面
只要存在這頁wordpress一吃到類似這種網址http://localhost/theme/category/分類名稱/
就會進入Category(category.php)
index.php (首頁)
category.php (分類頁面)
archive.php (彙整頁面)
search.php (搜尋結果頁面)
2012年5月9日 星期三
訂閱:
文章 (Atom)