20 12
发新话题
打印

把wordpress打造为cms

把wordpress打造为cms

http://www.storyday.com/html/y20 ... rdpress-as-cms.html
我为什么用wordpress做CMS
2007-02-04 11:55:38 发表于Wordpress, 网站技术 本文链接: 我为什么用wordpress做CMS
你看到这篇文章的时候,就知道本站是用wordpress完成的了,一直以来,我都是自己在写适合自己的CMS,我一直都认为自己写的CMS会比开源的那些快,因为我用了相应的缓存技术:其中包括了全静态的、samrty模板的、利用PEAR做缓存的等等。到了后来,人也比较懒了,就直接去sourceforge或者google寻找了。

寻找到了mambo、drupal、xoops、织梦CMS,还有些国内的CMS,可能是由于对国内的软件有偏见,一直到现在都没有用过国内的CMS。使用的mambo也在后来转向了joomla。

mambo或者joomla我发现有点复杂,虽然说他们的口号是power in simplicity,由于本人不喜欢看手册,而且mambo后台的那些菜单分类模块之间的关系我实在不想去理清,所以看了一下,完了几天就放弃了。不过说实在话,mambo的后台是我目前见到的CMS最漂亮了,而且它每个部分可以自定义模板,这个很不错,当初几乎就选定它了。

xoops太死板,整个网页都是一块一块的,没有办法美化,放弃之。

drupal功能强大,使用的网站相当多,包括一些比较大的网站都在使用。不过我装上之后研究了一个小时,发现drupal太活了,功能太多,我不需要那么复杂,而且用了两个小时都还没有理清关系+别人说drupal速度没有wp快,太打击积极性了,放弃之。

现在该说到wordpress,其实我也是在两个月以前才开始接触到wordpress的。装上之后,最初我用来做一个blog,发现还不错,后台的一切都是基于post来的,其实网页不就是很多post的么?而且看看分类比较清楚明了,基本就选定他了。 后来就开始研究他的模板结构,刚开始也无法下手。然后看了这张图片之后(参考:http://www.storyday.com/web-tech/260/wordpress-theme-tips)就非常清晰明了了,开始琢磨着把wp做成一个简单的CMS。

wordpress实现本站的cms的思想是这样的,现建立几个大分类(如本站的 生活工作 | Life&Work、 英语|English、 Web技术|WEB Tech),做为各个板块的分类。然后再个分类下建立子分类(如生活工作下的:生活理财|Financing、生活琐事|Life),做为该大分类频道下的分类 。然后在页面头部就把这个分类读出来做为菜单。

要为不同的频道做不同的界面也很简单(本站尚未这样做)。比如生活工作的id是5,那么就对应建立一个模板,名字为:category5.php,所以你有多少分类就可以有多少模板,相对灵活把?

可能你要问,首页的那些怎么获取的,简单啊,把你需要的类别下的文件用wordpress的template tag读出来放在你index.php模板中不就实现了么?呵呵。源代码如下:


Web 技术 | Web Tech
< ?php $posts = get_posts( "category=3&numberposts=12" ); ?>
< ?php if( $posts ) : ?>

< ?php foreach( $posts as $post ) : setup_postdata( $post ); ?>

< ?php the_time('m-d') ?>


旅游 | Travel
< ?php $posts = get_posts( "category=14&numberposts=8" ); ?>
< ?php if( $posts ) : ;?>

< ?php foreach( $posts as $post ) : setup_postdata( $post );
$post_id_array3[] = $post->ID;$perlink3[] = get_permalink($post->ID); ?>

< ?php the_time('m-d') ?> $meta_tmp = get_post_meta( $post_id_array3[$tmp], 'image', true) ;
if( "" == $meta_tmp ){ $tmp++ ;continue;}
else{
$dis_icon[$imgfield_index] = "“.get_post_meta( $post_id_array3[$tmp], ‘image’, true).”";
$imgfield_index ++ ;
$tmp++;
if ( $imgfield_index > 2) break;
}
}

?>

< ?php echo $dis_icon[0];?>
< ?php echo $dis_icon[1];?>
< ?php echo $dis_icon[2];?>

“.get_post_meta( $post_id_array3[$tmp], ‘image’, true).”";
$imgfield_index ++ ;
$tmp++;
if ( $imgfield_index > 2) break;
}
}

?>

< ?php echo $dis_icon[0];?>
< ?php echo $dis_icon[1];?>
< ?php echo $dis_icon[2];?>


(show/hide)plain text

Web 技术 | Web Tech
< ?php $posts = get_posts( "category=3&numberposts=12" ); ?>
< ?php if( $posts ) : ?>
< ?php foreach( $posts as $post ) : setup_postdata( $post ); ?>
< ?php the_time('m-d') ?>
旅游 | Travel
< ?php $posts = get_posts( "category=14&numberposts=8" ); ?>
< ?php if( $posts ) : ;?>
< ?php foreach( $posts as $post ) : setup_postdata( $post );
$post_id_array3[] = $post->ID;$perlink3[] = get_permalink($post->ID); ?>
< ?php the_time('m-d') ?> $meta_tmp = get_post_meta( $post_id_array3[$tmp], 'image', true) ;
if( "" == $meta_tmp ){ $tmp++ ;continue;}
else{
$dis_icon[$imgfield_index] = "".get_post_meta( $post_id_array3[$tmp], 'image', true)."";
$imgfield_index ++ ;
$tmp++;
if ( $imgfield_index > 2) break;
}
}
?>
< ?php echo $dis_icon[0];?>
< ?php echo $dis_icon[1];?>
< ?php echo $dis_icon[2];?>

首页的那些图片是怎么实现的呢??你知道wordpress有个自定义域么?对了,就是它,添文章的时候,如果文章有相关图片,写在域中,然后在首页取文章标题的同时把域中的图片路径取出来存在数组中,最后显示出来就是。代码参考上面代码的后面一段,如何增加自定义域请参见下图:



还有些你想订制的东西如何处理呢?建立里一个页面,设为private,然后在自定义域里面添加你需要的东西,在页面中引用就可以了,今后还可以随时修改。
wordpress还有一个好处就是模板实现简单,插件编写容易,以前我以为插件好高深,后来到wp的官方网站看了一下教程,马上就可以开始干活了,简单吧,你不妨也试试??

好了就写这么多。本文主要写wordpress,上面提及到的cms都很优秀,各有各的长处吧。

本文旨在抛砖引玉,各位wordpress爱好者发挥你的想象吧,你可以用wordpress做很多事情的。
乐乎设计,乐乎生活~

TOP

http://imsfox.com/20-great-websites-using-wordpress-as-cms.fox

20+优秀的CMS型WordPress网站


在众多的博客发布平台系统中,WordPress是公认最优秀也是最多人使用的。纵观如今日益庞大的WordPress使用群体,不少是网站设计者和中小型企业运营者,因此,我们有理由相信,WordPress现在已经不只是一个博客发布平台系统那么简单了,很多wpers都将自己的WordPress博客改得十分CMS就是很有力的佐证。不少人都想抛弃传统的CMS或者是觉得对静态网站的更新不好弄,转而使用WordPress作为他们的在线发布和内容管理系统。
下面是 rubiqube 收集并推荐的20个做得比较成功且设计十分优秀的CMS型WordPress网站,希望能给使用WordPress来做CMS站点的朋友一些有用的参考:
1. Cubicle Ninjas
http://cubicleninjas.com/

2. Ford Auto Shows
http://autoshows.ford.com/

3. Frisk Design
http://www.friskdesign.com/

4. Gaijin Film and Sound
http://www.gaijininternational.com/

5. Huck Magazine
http://www.huckmagazine.com/

6. Quasar Software
http://www.quasarsoft.net/

7. Aid - Sri Lanka
http://www.p2prescue.org/

8. Tim Wilson
http://tvwonline.net/

9. TP Hire
http://www.tp-hire.co.uk/

10. Executive Warfare
http://www.executivewarfare.com/

11. Feedback Audio
http://feedbackaudio.ca/

12. fraai
http://www.fraai-magazine.com/

13. Future Snowboarding Magazine
http://www.futuresnowboarding.com/

14. Ginger Restaurant
http://www.ginger-restaurant.co.za/

15. Inbound Pass
http://www.inboundpass.com/

16. International Screening Solutions
http://www.intlscreening.com/

17. kineda
http://www.kineda.com/
18. Little White Lies
http://www.kineda.com/

19. Miami Dating Coach
http://www.miamidatingcoach.com/

20. ten24media
http://www.1024media.com/
乐乎设计,乐乎生活~

TOP

http://rubiqube.com/

此网站不错,wp改造的,是罗马尼亚人,自由职业的网页设计师。

商业性很到位。
乐乎设计,乐乎生活~

TOP

http://rubiqube.com/6-wordpress- ... -worth-every-penny/
推荐的一些wp的主题,非常不错

http://themeforest.net
所推荐的主题的网上交易市场。
乐乎设计,乐乎生活~

TOP

很多站点用上了jQuery的效果

比如此链接所言。。。

ThemeForest网站模板设计大赛优秀获奖作品
http://www.th7.cn/Article/wy/sjln/200903/349389.html
乐乎设计,乐乎生活~

TOP

乐乎设计,乐乎生活~

TOP

Theme

Installing The Morning After is quite easy. Once you’ve downloaded the theme and extracted the files, upload the tma folder to your wp-content/themes/ directory. Next, go to the Presentation area in your WordPress administration panel and activate the theme.

Plugins

The following plugins are included with the theme (in the plugins folder): Post-Thumb Revisited, WP-Email and WP-Print. You don’t have to install the plugins — the theme works fine without them as well — but they add some extra functionality that would be quite useful for an online magazine and I recommend that you install them. Just upload everything in the plugins folder to your wp-content/plugins/ folder and activate the plugins from the Plugins page in your administration panel. I’ve customised the plugins to suit The Morning After theme.

Recommended WordPress version: Version 2.7+

Top ↑




Once the theme is activated, the first thing you need to do is to create two categories called Asides and Featured. After that’s done, your home page will be displayed correctly. Now, we move on to the good stuff. For best results, please disable the visual rich text editor from the Users > Your Profile page in your WordPress administration panel.

Top ↑




Custom fields are very useful for extending the functionality of a WordPress-powered web site. Each custom field consists of two parts, a key and the value for the key. A lot of the added functionality provided by The Morning After is based on custom fields.

One important thing that you should keep in mind is that you only need to create a new key once, after which you can assign a value to that key for every post. What this means is, you don’t need to create the required custom field keys for every post, you can select them from the drop down list in your Custom Fields section on the Write page. I know it seems obvious, but I just thought I’d mention it for people who aren’t used to using custom fields. You can read more about custom fields here.

Top ↑




Version 1.4 of the Morning After theme allows for the automatic generation of thumbnails for the ‘Recent Posts’ and ‘Featured Post’ sections on the home page. To enable this new feature, you need to install and activate the Post-Thumb Revisited plugin accompanying the theme, and set an appropriate path for storing generated thumbnails on the the plugin’s Basic Options page.

This is an optional feature, and you can continue to use custom fields for thumbnails (as in previous versions). You can also use custom fields for certain posts that you want to create your own thumbnails for, and let the rest be created automatically.

Top ↑




To add a description of your Web site on the home page (as seen in the preview), you need to create a Page called Description. Whatever content you enter in this Page will be displayed in the blue box on the home page.

Top ↑




As you see in the preview, there is a thin strip with a background image just below the header with the ‘title’ of the page. You will see different background images for the home page, posts/pages, and archives. Please feel free to change the background images to suit your tastes. Make sure your images have dimensions of 965 × 70 pixels, and name them as home_banner.png (for the home page), single_banner.png (for posts and pages), and archive_banner.png (for archives) respectively. Upload them to the wp-content/themes/tma/images/bg/ folder.

Top ↑




As you can see, the latest post is displayed prominently on the left hand side of the home page. By default, only the title and excerpt will be displayed. For best results, please enter an excerpt for the post in the Optional Excerpt section on the Write Post page. If you want to add an image to the latest post (as seen in the preview), you should create a custom field with key latest_home_img and the value as the name of the image (e.g. latestpost.jpg). This image should be saved in the wp-content/themes/tma/images/latest/ folder. Please ensure that the width of your image for the latest post doesn’t exceed 470 pixels.

Top ↑




To mark a post as “featured”, just make sure it belongs to the Featured category (which you created after you activated the theme). For best results, please enter an excerpt for the post in the Optional Excerpt section on the Write Post page.

To add a thumbnail image for the featured post (displayed on the home page), create a custom field with key featured_home_img and value as the name of the image (e.g. featuredthumb.jpg).

This image should be saved in the wp-content/themes/tma/images/featured/ folder. Please ensure that the thumbnail image for the featured post has dimensions of 64 × 64 pixels.

Version 1.4 of the Morning After theme allows for automatic generation of thumbnails. This feature is handy if you wouldn’t like to create thumbnails for every post.

Top ↑




The ‘Recent Posts’ area on the home page displays the next five latest posts (after the very latest one, in descending order). To add a thumbnail image to each of the posts, create a custom field with key thumb_home_img and value as the name of the image (e.g. featuredthumb.jpg). Please be sure to add this custom field for all posts (except asides).

This image (for each post) should be saved in the wp-content/themes/tma/images/thumbs/ folder. Please ensure that the thumbnail image has dimensions of 48 × 48 pixels.

Version 1.4 of the Morning After theme allows for automatic generation of thumbnails. This feature is handy if you wouldn’t like to create thumbnails for every post.

Top ↑




By default, the theme displays your web site’s title and description in the header. If you want to replace that with your logo, it’s easy to do. If you look at the source code for header.php, you will see the following:

<div class="title">     <div><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a></div>     <div class="desc"><?php bloginfo('description'); ?></div> </div>And below that is:

<!--<a href="<?php echo get_option('home'); ?>/" title="<?php bloginfo('description'); ?>" class="sitelogo"></a>-->Just delete the first block, and uncomment the second block of code (remove the <!−− at the beginning and −−> at the end), so you’re just left with this:

<a href="<?php echo get_option('home'); ?>/" title="<?php bloginfo('description'); ?>" class="sitelogo"></a>Save your logo as sitelogo.png and upload it to the wp-content/themes/tma/images/bg/ folder. Please ensure that the width of the logo doesn’t exceed 400 pixels, and that the height of the logo doesn’t exceed 90 pixels.

Top ↑




As of version 1.4, the Morning After theme supports WordPress’s in-built threaded comments functionality. This function is only available for WordPress 2.7+. To use this feature, you need to enable it on your Settings > Discussion page. Recommended comment nesting level: up to four levels deep.

Top ↑




As of version 1.4, the Morning After theme supports WordPress’s in-built image wrapping classes and image galleries.

Top ↑




An aside is basically a very short post, more like a note. It could be an interesting link that you want to share with your readers, or just a quick opinion about something. To publish asides using The Morning After, just write the short post as you would normally, and make sure it belongs to the Asides category (which you created after activating the theme). That’s it. Asides are displayed on the home page below the featured post.

Top ↑




If you installed and activated the WP-Email and WP-Print plugins, you should be able to offer your readers the option of emailing posts to friends and a print-friendly view for every post. The respective links will can be viewed below the title of the post. You might need to update your permalink structure after installing the plugins.

You can play around with the settings for the plugins in your administrative panel. The WP-Email plugin will create an extra tab in your header navigation called, well, E-mail, where you can tweak the settings under E-mail Options. For the WP-Print plugin, you can go to Options > Print.

If you are using the latest version of the Morning After theme, you can also use a widget (included in the theme download) to display the most emailed posts in your sidebar.

Top ↑




There are two main advertisement ‘blocks’ in The Morning After theme.

On the home page below the ‘Recent Posts’ section: This block accommodates a 250 × 250 pixels advertisement (maximum width, can be less than 250px as well; height can exceed 250px, but should preferably be 250px or less). To display an ad here, open ad_home.php and simply paste your advertisement code in the file. Save and upload, obviously. You can also add the advertisement code in the ad_home.php file using WordPress’s in-built theme editor.

On the sidebar below the list of categories: This block accommodates a 180 pixels wide advertisement (maximum width, can be less than 180px as well; no restrictions on height). To display an ad here, open ad_side.php and simply paste your advertisement code in the file. Save and upload. You can also add the advertisement code in the ad_side.php file using WordPress’s in-built theme editor. This advertisement will appear on the sidebar for all pages. To customise the display of your ads (show certain ads only for certain categories/posts, etc), you might want to look into conditional tags.
乐乎设计,乐乎生活~

TOP

不错的图片展示

http://ks.powereasy.net/article/112.html
Highslide 使用

Highslide是一款很好用的图片、画廊、多媒体展示效果代码。

说到Highslide,不得不先说一下这款代码也有用到的让人印象深刻的效果----Lightbox,一种相当流行的突出显示要展示内容的方式。当然,也有叫thickbox或者其它名字的,再译成中文,就更多千奇百怪的叫法了。
其典型的做法就是,点击页面上的链接时,弹出一个类似于对话框的居中区域,用于展示主要的内容;除去屏幕中心位置的这个对话框,其他的区域都以淡出的方式逐渐变暗。这和Windows操作系统的注销/关机对话框出现时的效果差不多。也许,最早使用这种展示效果的设计师正是从这里汲取灵感的吧。
一般讨论到Lightbox就是指这种效果,这种除滚动、书签式切换外用于交互显示页面可隐藏内容的广泛流行的方式。
但Lightbox最早的时候是指Lokesh Dhakar制作的一个用来放大显示图片覆盖于当前页面之上的效果代码:http://www.huddletogether.com/projects/lightbox2/
这个代码也同样是相当流行的,还和Highslide做成wordpress的插件。
flash展示与highslide结合的应用:
http://www.ks-pe.com/Skin/ksAlbum.html

实际上,highslide的功能和可配置的内容还远不止这些。下载回来试试吧!

http://highslide.com/
乐乎设计,乐乎生活~

TOP

http://www.blueprintcss.org/

一个ccs框架站点~
乐乎设计,乐乎生活~

TOP

http://www.wopus.org/wordpress-deepin/tech/1757.html
项目管理系统插件

http://themes.wopus.org/wpthemes/micro-theme/2296.html
wp的微博p2
似乎ie8下面有点问题~
乐乎设计,乐乎生活~

TOP

http://www.problogdesign.com/

一个非常不错的博客设计专家~~值得学习一下~~

http://www.treyratcliff.com/
一个相册的展示,效果不错~

[ 本帖最后由 happyfan 于 2010-1-8 17:01 编辑 ]
乐乎设计,乐乎生活~

TOP

http://www.airtightinteractive.com/

simpleview一个基于flash的图片浏览器~十分不错~

应该是下面的一个~
http://www.simpleviewer.net/

乐乎设计,乐乎生活~

TOP

似乎lightbox 2与某些wp主题不兼容,造成问题,问题在于css样式的重叠。

_________

问题解决了,果然是如此的问题。
乐乎设计,乐乎生活~

TOP

http://visuallightbox.com/
以lb2为库的一个相册~
乐乎设计,乐乎生活~

TOP

http://stimuli.ca/lightbox/

wp作者的首页
乐乎设计,乐乎生活~

TOP

 20 12
发新话题