Bill: WordPress Template Technical Manual-WordPress Theme Technical Manuals

Source: Internet
Author: User
Tags wordpress version

WordPress Basic Template file

A complete set of WordPress templates should have at least the following files:

Style.css:CSS (style sheet) file
index.php: Home Templates
Archive.php:archive/category templates
404.php:not Found Error page template
comments.php: Message/reply template
Footer.php:Footer templates
Header.php:Header templates
sidebar.php: Side bar Template
page.php: Content page (page) template
single.php: Content page (Post) template
searchform.php: Searching for form templates
search.php: Search Results Template


Of course, specific to a specific template may be more than these files, but in general, these files are required for each set of templates.

Basic Condition Judgment Tag

Is_home (): Whether it is a home page
Is_single (): Whether it is a content page (Post)
Is_page (): Whether it is a content page (page)
Is_category (): Is category/archive page
Is_tag (): Is the Tag archive page
Is_date (): Whether to archive pages for the specified date
Is_year (): Whether to archive pages for the specified year
Is_month (): Whether to archive pages for the specified month
Is_day (): Whether to archive pages for the specified day
Is_time (): Whether to archive pages for a specified time
Is_archive (): Whether it is an archive page
Is_search (): Whether it is a search results page
Is_404 (): Is an "HTTP 404:not Found" error page
Is_paged (): Home/category/archive page is displayed in multiple pages


PHP functions commonly used in the header section

<?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 page HTML type
<?php bloginfo (' CharSet ');?>: Blog page encoding
<?php bloginfo (' description ');?>: Blog description
<?php wp_title ();?>: Title of a specific content page (Post/page)


PHP functions and commands commonly used in templates

<?php Get_header ();?>: Calling the header template
<?php Get_sidebar ();?>: Call sidebar template
<?php Get_footer ();?>: Call footer Template
<?php the_content ();?>: Display content (Post/page)
<?php if (have_posts ()):?>: Check for presence Post/page
<?php while (Have_posts ()): The_post ();?>: Display if Post/page is present
<?php Endwhile;?>: While ends
<?php endif;?>: If End
<?php the_time (' string ')?>: Display time, time format determined by "string" parameter, refer to PHP manual
<?php Comments_popup_link ();?>: The message link in the text. If you use Comments_popup_script (), the message opens in a new window, or vice versa, in the current window
<?php the_title ();?>: Content page (post/page) title
<?php The_permalink ()?>: Content page (post/page) Url
<?php the_category (', ')?>: category for specific content pages (Post/page)
<?php The_author ();?>: Author
<?php the_id ();?>: Specific content page (post/page) ID
<?php Edit_post_link ();?>: If the user is logged in and has permission to display the edit link
<?php get_links_list ();?>: Show links in Blogroll
<?php comments_template ();?>: Call message/reply template
<?php wp_list_pages ();?>: Show Page List
<?php wp_list_categories ();?>: Show Categories list
<?php next_post_link ('%link ');?>: Next post link
<?php previous_post_link ('%link ');?>: Previous post link
<?php Get_calendar ();?>: Calendar
<?php wp_get_archives ()?>: Show content Archive
<?php Posts_nav_link ();?>: navigation, displaying previous/next article links
<?php include (TemplatePath. '/filename ');?>: Embed other files that can be customized templates or other types of files


Other functions related to templates

<?php _e (' message ');?>: Output the appropriate information
<?php Wp_register ();?>: Show Registration link
<?php wp_loginout ();?>: Show Login/Logout link
<!–next page–>: Paging the current content
<!–more–>: Truncate the current content to not show all content on the Home/catalog page
<?php timer_stop (1);?>: Page load time (seconds)
<?php echo get_num_queries ();?>: Page load Query volume


Of course, these are the most basic things related to the template, more detailed information, please refer to

Bill: WordPress Template Technical Manual-WordPress Theme Technical Manuals

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.