ArticleDirectory
- A complete set of WordPress templates should have at least the following files:
A complete set of WordPress basic template files should have at least the following files:
- Style.css: CSS (style sheet) File
- Index. php: homepage Template
- Archive. php: Archive/Category Template
- 404. php: Not Found error page template
- Comments. php: Message/reply Template
- Footer. php: footer Template
- Header. php: Header Template
- Sidebar. php: sidebar Template
- Page. php: Content Page Template
- Single. php: Content Page (post) template
- Searchform. php: search form templates
- Search. php: search result Template
Of course, specific to a specific template may not be more than these files, but in general, these files are essential for each template.
Tag of basic condition judgment
- Is_home (): whether it is the Home Page
- Is_single (): whether it is a content page (post)
- Is_page (): whether it is a content page)
- Is_category (): whether it is a category/archive page
- Is_tag (): whether it is a tag archiving page
- Is_date (): whether to specify the date archive page
- Is_year (): Specifies whether the year is archived.
- Is_month (): Specifies whether the month is archived.
- Is_day (): Indicates whether to specify a day archive page.
- Is_time (): Specifies whether the time archive page is used.
- Is_archive (): whether it is an archive page
- Is_search (): whether it is a search result page
- Is_404 (): whether it is an "HTTP 404: Not Found" error page
- Is_paged (): whether the homepage/category/archive page is displayed in multiple pages
Common PHP Functions
- <? PHP bloginfo ('name');?> : Blog name (title)
- <? PHP bloginfo ('stylesheet _ url');?> : CSS file path
- <? PHP bloginfo ('pingback _ url');?> : Pingback URL
- <? PHP bloginfo ('template _ url');?> : Template File Path
- <? PHP bloginfo ('version');?> : Wordpress version
- <? PHP bloginfo ('Atom _ url');?> : Atom URL
- <? PHP bloginfo ('rss2 _ url');?> : RSS 2.o URL
- <? PHP bloginfo ('url');?> : Blog URL
- <? PHP bloginfo ('html _ type');?> : Blog webpage HTML type
- <? PHP bloginfo ('charset');?> : Blog webpage code
- <? PHP bloginfo ('description');?> : Blog description
- <? PHP wp_title ();?> : The title of a specific content page (post/Page)
Webpage TemplateCommon PHP functions and commands
-
- <? PHP get_header ();?> : Call HeaderTemplate
-
- <? PHP get_sidebar ();?> : Call the sidebar Template
- <? PHP get_footer ();?> : Call footer Template
-
- <? PHP the_content ();?> : Display content (post/Page)
-
- <? PHP if (have_posts ():?> : Check whether post/page exists
-
- <? PHP while (have_posts (): the_post ();?> : If post/page exists, it is displayed.
-
- <? PHP endwhile;?> : While ends
-
- <? PHP endif;?> : If ends
-
- <? PHP the_time ('string')?> : Display time. The time format is determined by the "string" parameter. For more information, see the PHP manual.
-
- <? PHP comments_popup_link () ;?> : Message link in the body. If comments_popup_script () is used, the message is displayed in the new window. Otherwise, the message is displayed in the current window.
-
- <? PHP the_title ();?> : Content Page (post/Page) Title
-
- <? PHP the_permalink ()?> : Content Page (post/Page) URL
-
- <? PHP the_category (',')?> : Category of a specific content page (post/Page)
-
- <? PHP the_author ();?> : Author
-
- <? PHP the_id ();?> : Specific content page (post/Page) ID
- <? PHP edit_post_link ();?> : If the user has logged on and has permissions, the edit link is displayed.
-
- <? PHP get_links_list ();?> : Display links in blogroll
-
- <? PHP comments_template ();?> : Call the message/reply Template
-
- <? PHP wp_list_pages ();?> : Display page list
-
- <? PHP wp_list_categories ();?> : Display the categories list
-
- <? PHP next_post_link ('% link');?> : Next article link
-
- <? PHP previus_post_link ('% link');?> : Link to the previous article
-
- <? PHP get_calendar ();?> : Calendar
-
- <? PHP wp_get_archives ()?> : Display content archival
-
- <? PHP posts_nav_link ();?> : Navigation, displaying the link of the previous or next article
-
- <? PHP Include (templatepath. '/filename');?> : Embed other files, which can be customizedWebsite templateOr other types of files
Other template-related functions
- : Output corresponding information
- : Display registration link
- : Display logon/Logout link
- : pagination of the current content
- : truncate the current content so that all content is not displayed on the homepage/directory page.
- : Webpage loading time (seconds)
- : Web page loading query volume