2008-06-22 /
admin /
One Comment
Excellent observations, especially number three and number five? In the long run, you cannot “trick” people into visiting, much less continually reading your blog. You must honestly identify a problem and provide a solution. After you provide value
Excellent observations, especially number three and number five? In the long run, you cannot “trick” people into visiting, much less continually reading your blog. You must honestly identify a problem and provide a solution. After you provide value comes number five – it enables you to connect with your readers in a way that makes them realize the website they’re looking it is a vehicle for a human voice, not some machine tossing data at them.
Excellent observations, especially number three and number five? In the long run, you cannot “trick” people into visiting, much less continually reading your blog. You must honestly identify a problem and provide a solution. After you provide value.
2008-06-22 /
admin /
One Comment
Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!
2008-06-22 /
admin /
One Comment
OK,今天就继续《
"http://www.sofish.de/archives/457/">告诉你如何做一个CMS型WORDPRESS主题》系列的文章吧。上次我们讲了,如何让文章像你想要的方式显示的
"http://www.sofish.de/archives/459/">初级篇。一般情况下,上面的文章的介绍已经可以满足你的要求了。但我们可能需要更不同的效果,这就是今天我们要说的,进阶篇,主要有下面两点:
-
用1个以上的循环调用不重复的文章
-
可能导致分页出问题的代码
-
利用CSS+插件让首页文章像想要的方式显示
-
用1个以上的循环调用不重复的文章
-
<?php $my_query = new WP_Query('showposts=1');
-
while ($my_query->have_posts()) : $my_query->the_post();
-
$do_not_duplicate = $post->ID; ?>
- //
第一篇文章,或者前几篇文章,需要设置showposts=1的值,1是文章数量
-
<?php endwhile; ?>
- //
通常这里放AD 比如728×90的GGAD
-
<?php if (have_posts()) : while (have_posts()) : the_post();
-
if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?>
- //
后续的文章放这里,比如你在后台设置了10篇,上面显示1篇,那么这里将显示9篇
-
<?php endwhile; endif; ?>
值得注意的是上面的$do_not_duplicate,这个变量使得文章不会重复显示,在
"http://www.sofish.de/archives/459/">上一篇文章中,我们已经标示,让大家注意,我自己也没有看过WP程序的完整内容,所以,也不知道,但这里还是提出来,引起大家的注意。
另外,我觉得最重要的是,这段代码可以根据后台的设置来显示,而不是在代码中定义。这样无论是做一个免费主题,还是自用的主题,都是非常重要的,因为不需要修改代码,就可以作更改,这也是我们想要的。并且,他不会出现下面我们要讨论的问题--不能分页!
-
可能导致分页出问题的代码
之前,在Jinwen的讲的CUSTOM
FIELD文章中,遇到其提供的代码,可以让文章显示不同的样式。但,首页却不能分页。这是非常麻烦的事,至少我自己不能容忍这样的情况出现。不过,如果用上面的代码,完全可以不用担心这样的事情发生。所以,提到这个,更多的是希望,找出多种解决方法,让大家有所选择。
我这里就不多讲了,同样是Jinwen这个可爱的家伙,又写了一篇文章,专门解决这个问题,大家请看《
"http://smartr.cn/wordpress/how-to-use-query-posts-in-wordpress.html">我的WordPress主题这样做(3)-文章质疑应用》这里有详细的介绍。
BTW:这里,不得不再啰嗦一下,推荐这个WP Fan。相信有很多人也认识Jinwen吧,他写了很多不错的WP文章,特别是最近,一直在出WP系列的教程。推荐大家多多去看。至少,我自己在他那里学到挺多有用的东西。
-
利用CSS+插件让首页文章像想要的方式显示
到了这一点,我想,相对属于发挥大家创造性的内容了。你可能见过付费主题,他们首页的文章都表现得非常棒。大小相同,更漂亮地控制了版面的显示方式。我们都希望实现这样的效果。因为追求美是我们共同的目标。
对于实现这样的效果,这里也不重复说。大家可以看看我写过的一篇文章:这里会告诉你如何做的。相信你也可以做得非常棒。
OK,进阶篇就此完结了。内容不算多,不过,相对来说,都是比较重要的。有时候很多内容,但是只要我们一学就会。但总有一两个小的,难发现的,比如不能分页。从发现到解决,可能需要耗费我们大量的时间。这篇文章就是为了解决这个问题而写的。
相同的话,如果你没有看过前面的文章,那么请看
"http://www.sofish.de/archives/457/">告诉你如何做一个CMS型Wordpress主题这个目录。如果你希望在最快的时间得到下一篇的消息,那么,
"http://feed.feedsky.com/sofish">订阅我吧!
2008-05-01 /
admin /
31 Comments
The way I see it, having a blog is like giving birth or doing a new piece of art every day. People don’t realise how much work goes into them — how much we love them, sweat & toil over them, & analyse everything about them. So when someone swings by & tries to take a shot at you, it’s kind of like them urinating all over your new-born, or slashing at your painting. It’s rude & vulgar, & not to be tolerated. They can say what they like, but not on your site. If they want to spew vitriol, they can do it somewhere else. I mean, would you invite someone like that into your house? To my mind, it’s exactly the same thing.