CMS类Wordpress主题使用教程

This item was filled under [ 一步一步学习中 ]

CMS类主题无疑是眼下最受欢迎的Wordpress主题,前段时间Wopus中文平台也适时的为大家搜集、整理了Wordpress十大免费CMS主题,反响不错!可是这些CMS主题都很个性化,很多同学还不会使用,现在我以有名的Mimbo2.2主题为例,给大家详细的讲解下如何使用CMS主题:

1. 调用某个分类文章的第一篇文章作为头条

query_posts(’showposts=1&cat=86′)
(修改86为你想显示的分类id)
当然,你也可以像Wopus中文平台一样,调用最新的一篇文章作为头条:
query_posts(’showposts=1′)
2. 调用Custom Fields图片

每次撰写新文章时,就须:

在Custom Fields区域添加“Image”自定义字段,具体如下图:
customfields_images
3. 左、右侧分类文章调用方法参照第一、二步
4. 某些主题还必须开启所需插件或在后台设置,请各位使用时务必仔细阅读使用说明

怎么样,CMS类主题使用起来也不是那么难吧。
另:Mimbo2.2这款主题已经汉化,主题文件里也有备注,具体请看:Mimbo2.2汉化版

Bookmark and Share
Tagged with: [ ]

WordPress Theme SubtleZen Released

This item was filled under [ 一步一步学习中 ]

主题简介:宽屏两栏主题,又一款Daily Blog Tips的主题,该作者的几个主题都是非常不错的,我也都非常喜欢,个人觉得,这个属最特别吧,颜色的整体搭配很不错!这是一款精美的主题! 详细链接:点击查看

Bookmark and Share
Tagged with: [ ]

WordPress Theme DeepBlue Released

This item was filled under [ 一步一步学习中 ]

主题简介:宽屏三栏主题,有三款样式可供选择,非常不错的一款主题,具体请看DEMO吧。 详细链接:点击查看

Bookmark and Share
Tagged with: [ ]

WordPress Theme Fotosky Released

This item was filled under [ 一步一步学习中 ]

主题简介:宽屏三栏主题,支持Widget,所以两个侧边栏可以任意的按自己的喜好修改。这样的主题不需要太多的评价,从Demo中相信大家能看出来,这是一款精美的主题!

Bookmark and Share

蓝色主题DynaBlue完全使用手册

This item was filled under [ 一步一步学习 ]

主题地址:http://themes.wopus.org/wpthemes/two-column/1242.html

1、这款主题有很多广告位可以使用,在主题LOGO右侧,可以放置一个468×60的banner广告。
添加办法:
在 header.php中找到如下代码:
view source
print?
1.
< ?php theme_banner_468_ads_show(); ?>

找到广告代码,替换
view source
print?
1.< ?php theme_banner_468_ads_show(); ?>

2、顶部幻灯片轮换这里,展示4篇文章,这里可以只是文字,也可以是图文的,图片大小是:161×107,这里需要使用到这个插件:featureme.zip,启用插件之后,在发布日志页面,最下方有一行文字:This is a really cool entry, Feature it!,勾选之后,这篇日志就会出现在幻灯片轮换这里了。
如果需要在幻灯片轮换中加入图片,需要使用到自定义字段功能,创建一个名为:thumbnail的自定义字段,然后自定义字段的值是图片的完整路径。

3、Feed的地址可以通过在header.php里添加。Twitter的地址可以在后台添加。ID就是在twitter上的登录用户名。

4、这款主题有九宫格,但是我在主题后台找了很久都没有找到实现的方法,不知道是不是在widgets的text里添加代码来完成的。

主题的使用基本就到这里了。主题还是很不错的,大家可以配合这篇教程来使用这款主题。

Bookmark and Share
Tagged with: [ ]

Developing a Model-View-Controller Component – Part 4 – Creating an Administrator Interface

This item was filled under [ joomla ]

Introduction

In the first three tutorials, we have developed a MVC component that retrieves its data from a table in the database. Currently, there is no way to add data to the database except to do it manually using another tool. In this tutorial, we will develop an administrator section for our component which will make it possible to manage the entries in the database.
阅读更多…

Bookmark and Share

Developing a Model-View-Controller Component – Part 3 – Using the Database

This item was filled under [ joomla ]

Introduction

In the first two tutorials, we showed you how to build a simple model-view-controller component. We had one view which retrieved data from a model (which was created in the 2nd tutorial). In this tutorial, we will be working with the model. Instead of the data being hard coded in the model, the model will retrieve the data from a table in the database.

This tutorial will demonstrate how to use the JDatabase class to retrieve data from the database.
阅读更多…

Bookmark and Share

Developing a Model-View-Controller Component – Part 2 – Adding a Model

This item was filled under [ joomla ]

Introduction

In the first tutorial of this series, creating a simple view-controller component using the Joomla! 1.5 CMS framework was demonstrated.

In the first tutorial, the greeting was hardcoded into the view. This doesn’t follow the MVC pattern exactly because the view is intended to only display the data, and not contain it.

In this second part of the tutorial we will demonstrate how to move this out of the view and into a model. In future tutorials we will demonstrate the power and flexibility that this design pattern provides.
阅读更多…

Bookmark and Share

Developing a Model-View-Controller Component – Part 1

This item was filled under [ 一步一步学习中 ]

Introduction

A software framework is the base of an application that can be used by a developer. The framework in Joomla! 1.5 unleashes a great deal of power for them. The Joomla! code has been completely overhauled and cleaned up. This tutorial will guide you through the process of developing a component using the framework.

The scope of this project will be to develop a simple Hello World! component. In future tutorials, this simple framework will be built upon to show the full power and versatility of the MVC design pattern in Joomla! 阅读更多…

Bookmark and Share

Python、Unicode和中文

This item was filled under [ 一步一步学习中 ]

#转载 (来源:http://blog.csdn.net/lwl_ls/archive/2007/08/21/1753284.aspx,晕倒,python的中文编码确实有点问题,如果是用SGMLParser解析模块确实有点问题本文的最后一个方案可解决该编码问题)

Python、Unicode和中文

python的中文问题一直是困扰新手的头疼问题,这篇文章将给你详细地讲解一下这方面的知识。当然,几乎可以确定的是,在将来的版本中,python会彻底解决此问题,不用我们这么麻烦了。

先来看看python的版本:
>>> import sys
>>> sys.version
‘2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)]‘

(一)
用记事本创建一个文件ChineseTest.py,默认ANSI:
s = “中文”
print s

测试一下瞧瞧:
E:\Project\Python\Test>python ChineseTest.py
File “ChineseTest.py”, line 1
SyntaxError: Non-ASCII character ‘\xd6′ in file ChineseTest.py on line 1, but no encoding declared; see http://www.pytho
n.org/peps/pep-0263.html for details

偷偷地把文件编码改成UTF-8:
E:\Project\Python\Test>python ChineseTest.py
File “ChineseTest.py”, line 1
SyntaxError: Non-ASCII character ‘\xe4′ in file ChineseTest.py on line 1, but no encoding declared; see http://www.pytho
n.org/peps/pep-0263.html for details

无济于事。。。
既然它提供了网址,那就看看吧。简单地浏览一下,终于知道如果文件里有非ASCII字符,需要在第一行或第二行指定编码声明。把ChineseTest.py文件的编码重新改为ANSI,并加上编码声明:
# coding=gbk
s = “中文”
print s

再试一下:
E:\Project\Python\Test>python ChineseTest.py
中文

正常咯:)
(二)
看一看它的长度:
# coding=gbk
s = “中文”
print len(s)
结果:4。
s这里是str类型,所以计算的时候一个中文相当于两个英文字符,因此长度为4。
我们这样写:
# coding=gbk
s = “中文”
s1 = u”中文”
s2 = unicode(s, “gbk”) #省略参数将用python默认的ASCII来解码
s3 = s.decode(“gbk”) #把str转换成unicode是decode,unicode函数作用与之相同
print len(s1)
print len(s2)
print len(s3)
结果:
2
2
2
(三)
接着来看看文件的处理:
建立一个文件test.txt,文件格式用ANSI,内容为:
abc中文
用python来读取
# coding=gbk
print open(“Test.txt”).read()
结果:abc中文
把文件格式改成UTF-8:
结果:abc涓枃
显然,这里需要解码:
# coding=gbk
import codecs
print open(“Test.txt”).read().decode(“utf-8″)
结果:abc中文
上面的test.txt我是用Editplus来编辑的,但当我用Windows自带的记事本编辑并存成UTF-8格式时,
运行时报错:
Traceback (most recent call last):
File “ChineseTest.py”, line 3, in <module>
print open(“Test.txt”).read().decode(“utf-8″)
UnicodeEncodeError: ‘gbk’ codec can’t encode character u’\ufeff’ in position 0: illegal multibyte sequence

原来,某些软件,如notepad,在保存一个以UTF-8编码的文件时,会在文件开始的地方插入三个不可见的字符(0xEF 0xBB 0xBF,即BOM)。
因此我们在读取时需要自己去掉这些字符,python中的codecs module定义了这个常量:
# coding=gbk
import codecs
data = open(“Test.txt”).read()
if data[:3] == codecs.BOM_UTF8:
data = data[3:]
print data.decode(“utf-8″)
结果:abc中文

(四)一点遗留问题
在第二部分中,我们用unicode函数和decode方法把str转换成unicode。为什么这两个函数的参数用”gbk”呢?
第一反应是我们的编码声明里用了gbk(# coding=gbk),但真是这样?
修改一下源文件:
# coding=utf-8
s = “中文”
print unicode(s, “utf-8″)
运行,报错:
Traceback (most recent call last):
File “ChineseTest.py”, line 3, in <module>
s = unicode(s, “utf-8″)
UnicodeDecodeError: ‘utf8′ codec can’t decode bytes in position 0-1: invalid data
显然,如果前面正常是因为两边都使用了gbk,那么这里我保持了两边utf-8一致,也应该正常,不至于报错。
更进一步的例子,如果我们这里转换仍然用gbk:
# coding=utf-8
s = “中文”
print unicode(s, “gbk”)
结果:中文
翻阅了一篇英文资料,它大致讲解了python中的print原理:
When Python executes a print statement, it simply passes the output to the operating system (using fwrite() or something like it), and some other program is responsible for actually displaying that output on the screen. For example, on Windows, it might be the Windows console subsystem that displays the result. Or if you’re using Windows and running Python on a Unix box somewhere else, your Windows SSH client is actually responsible for displaying the data. If you are running Python in an xterm on Unix, then xterm and your X server handle the display.

To print data reliably, you must know the encoding that this display program expects.

简单地说,python中的print直接把字符串传递给操作系统,所以你需要把str解码成与操作系统一致的格式。Windows使用CP936(几乎与gbk相同),所以这里可以使用gbk。
最后测试:
# coding=utf-8
s = “中文”
print unicode(s, “cp936″)
结果:中文

Bookmark and Share
Page 10 of 46« First...«89101112»203040...Last »