Home » 乱七八糟 » 【转】wordpress主题模板制作文件及调用函数

【转】wordpress主题模板制作文件及调用函数

最近看上了一款皮肤,但是它的布局是CMS格式的,不适合我这种文章内容少、分类少、图片不太多的博客
于是我想着给他改一改。。前前后后折腾了几个小时还是没能折腾出啥明显的成效,于是我就萌生了照着那款皮肤的感觉自己做一个皮子的想法。。。我承认。。我是看见博友爱惜同学有一个他自己的皮肤我小小滴嫉妒了一把。。哈哈 :ahh: 想法产生就开始要实际行动了,在我跨出着“实质性的一步”之后我发现了个很囧很囧的事情。。我都还不知道WordPress的调用函数都有哪些呢,我怎么写 :le: 于是,通过我们的百度大婶(我真的不想提它。。- -)找到了这篇文章,于是就转过来了,省得以后需要用上的时候忘记去哪里看了,呵呵
有了这些东西应该可以考虑着手写写皮肤了吧,希望我的第一款皮肤不会夭折,拜拜神~~


Basic Template Files

style.css

index.php

single.php

archive.php

searchform.php

search.php

404.php

comments.php

footer.php

header.php

sidebar.php

page.php

Style sheet ­file

Home page ­file

Single post page ­file

Archive/category ­file

Search form ­file

Search content ­file

Error page ­file

Comments template ­file

Footer content ­file

Header content ­file

Sidebar content ­file

Single page ­file

PHP Snippets for Header

<?php bloginfo(‘name’); ?>

<?php wp_title(); ?>

<?php bloginfo(’stylesheet_url’); ?>

<?php bloginfo(‘pingback_url’); ?>

<?php bloginfo(‘template_url’); ?>

<?php bloginfo(‘version’); ?>

<?php bloginfo(‘atom_url’); ?>

<?php bloginfo(‘rss2_url’); ?>

<?php bloginfo(‘url’); ?>

<?php bloginfo(‘name’); ?>

<?php bloginfo(‘html_type’); ?>

<?php bloginfo(‘charset’); ?>

Title of the site

Title of the speci­c post or page

The style.css ­le’s location

Pingback URL for the site

Location for the site’s theme ­les

WordPress version for the site

Atom URL for the site

RSS2 URL for the site

Exact URL for the site

Name of the site

HTML version of the site

Charset parameter of the site

PHP Snippets for Templates

<?php the_content(); ?>

<?php if(have_posts()) : ?>

<?php while(have_posts()) : the_post(); ?>

<?php endwhile; ?>

<?php endif; ?>

<?php get_header(); ?>

<?php get_sidebar(); ?>

<?php get_footer(); ?>

<?php the_time(‘m-d-y’) ?>

<?php comments_popup_link(); ?>

<?php the_title(); ?>

<?php the_permalink() ?>

<?php the_category(‘, ‘) ?>

<?php the_author(); ?>

<?php the_ID(); ?>

<?php edit_post_link(); ?>

<?php get_links_list(); ?>

<?php comments_template(); ?>

<?php wp_list_pages(); ?>

<?php wp_list_cats(); ?>

<?php next_post_link(‘ %link ‘) ?>

<?php previous_post_link(‘%link’) ?>

<?php get_calendar(); ?>

<?php wp_get_archives() ?>

<?php posts_nav_link(); ?>

<?php bloginfo(’description’); ?>

Content of the posts

Checks if there are posts

Shows posts if posts are available

Closes the ‘while’ PHP function

Closes the ‘if’ PHP function

Header.php ­le’s content

Sidebar.php ­le’s content

Footer.php ­le’s content

The date in ‘08-18-07′ format

Link for the comments on the post

Title of a speci­c post or page

Url of a speci­c post or page

Category of a speci­c post or page

Author of a speci­c post or page

ID of a speci­c post or page

Link to edit a speci­c post or page

Links from the blogroll

Comment.php ­le’s content

List of pages of the

List of categories for the site

Url to the next post

Url to the previous post

The built-in calendar

List of archives for the site

Next and previous post link

Site’s description

Extra Stu­

/%postname%/

<?php include(TEMPLATEPATH . ‘/x’); ?>

<?php the_search_query(); ?>

<?php _e(’Message’); ?>

<?php wp_register ; ?>

<?php wp_loginout(); ?>

<!–next page–>

<!–more–>

.

<?php wp_meta(); ?>

<?php timer_stop(1); ?>

<?php echo get_num_queries(); ?>

Custom permalinks

Include any file

Value for search form

Prints out message

Displays the register link

Displays the login/logout link

Divides the content into pages

Cuts off the content and adds a link to the rest of the content

Meta for administrators

Time to load the page

Queries to load the page

感谢木瓜•可可西同学分享以上内容,原文出处:http://12510.info/production-of-documents-and-templates-wordpress-theme-function.html

Related Posts

Most Popular

24 Comments.

⊕Leave a comment?
  1. 昨天还看来着,有些还不大看得懂~

    沙发主!坐他大腿!
  2. 俺只知道杂用 :eee: :qq: ~~~别的不懂。。。 :ahh:

    板凳主!
  3. 俺只知道杂用 :eee: ~~~别的不懂。。。 :ahh:

    地板主!
  4. 俺只知道杂用~~~别的不懂。。。 :ahh:

    4楼
  5. 这个。明显是我看不懂的嘛~ :qq:

    5楼
  6. 很齐全,要是解释是中文就更好了!

    6楼
  7. 慢慢来。千万不要夭折啊,不懂就在论坛上多问问吧。期待你修改版出来呀。

    7楼
    • @爱惜, 昨天毕业论文任务书发下来了。。。看来这个也只有慢慢来了哦~呵呵。
      PS:我的回复是有嵌套的啊。。你看看别人的留言就看的出来了。。是在留言人姓名后面有个不是太明显的一个箭头图案,点了就可以嵌套回复了。。呵呵。。不仔细看还是有点困难的哈,懒得改了,等做出来了直接换皮 :cahan:

  8. 又是个高手噢。前来学习一下。

    8楼
  9. 你的好像没有嵌套回复哦。
    tstyle这主题不是CMS类么?改成普通的适合博客类型的貌似难度不是一般的大。我也是改改别的人的主题,只限于小改可以,大改完全不行。目前用的主题完全靠 未命名文档 修改的那么出色。我只是照搬拿来改下小东西而已!
    我要是折腾了一些新效果一有问题就上WP论坛求助。在那里我大多是求助帖。嘿嘿。

    9楼
    • @爱惜, 我目前感觉需要改的也只是他的日志展示方式以及sidebar那边的少量类容就可以了。。(因为啥也不懂,所以感觉貌似什么都能改- -),还没怎么研究,临近期末了,事多起来了,但愿不会夭折吧 :yaa:

  10. 其实我也看过很多设计还不错的主题,想改改自己。可惜自己不懂。所以只好放弃了。

    10楼
    • @爱惜, 我自己不会设计样式。。漂亮的图做不出来。。漂亮的构思也构思不出来 @_@ 改改别人的还凑合- -

  11. 突然看见有我的名字。哈。
    我的皮肤不是我自己做的,是 未命名文档 修改自虾米大虾的皮肤!你要的话我可以发一份给你!
    PS:本来我打算换一个主题试试,被你这样一说不舍得换了,嘿嘿。

    11楼
    • @爱惜, 可千万别谦虚哦~呵呵。
      话说回来你的主题看着挺有感觉的 :woo: 我也是那天突然看见tstyle这款主题,感觉它挺精致的。。就萌生了想改改后纳为己用的想法了 :yaa:

  12. Php的。不懂。嘿嘿!

    12楼
  13. 有一本流传已久的pdf,手把手教你做wp主题,你看过了吗?
    不知道有没有帮助

    13楼
    • @Leyeang, 你说的是那个水煮鱼发布的pdf么?我今天也有找到个pdf,也只找到这一个。。99页。。压力啊 – -

  14. 看着似乎很不错啊

    14楼

Leave a Reply

:zz: :woo: :cahan: :qq: :nal: :bye: :ahh: :kul: :yaa: :eee: :fak: :yaae: :but: :yaaa: more »

Go to comments
Go to comments