• admin changed their profile picture 8 years, 4 months ago

  • admin changed their profile picture 8 years, 4 months ago

  • single-{post-type}.php
    The single post template used when a single post from a custom post type is queried. For example, single-books.php would be used for displaying single posts from the custom post type named “books”. index.php is used if the query template for the custom post type is not present.

  • index.php
    The main template. If your Theme provides its own templates, index.php must be present.

  • rtl.css
    The rtl stylesheet. This will be included automatically if the website’s text direction is right-to-left. This can be generated using the the RTLer plugin.

  • style.css
    The main stylesheet. This must be included with your Theme, and it must contain the information header for your Theme

  • Here is the list of the Theme files recognized by WordPress. Of course, your Theme can contain any other stylesheets, images, or files. Just keep in mind that the following have special meaning to WordPress — see Template Hierarchy for more information.

  • admin replied to the topic Basic Templates in the forum Template Files 8 years, 4 months ago

    Typical template files include:

    comments.php
    comments-popup.php
    footer.php
    header.php
    sidebar.php

  • admin replied to the topic Basic Templates in the forum Template Files 8 years, 4 months ago

    Or, it can be divided into modular template files, each one taking on part of the workload. If you do not provide other template files, WordPress may have default files or functions to perform their jobs. For example, if you do not provide a searchform.php template file, WordPress has a default function to display the search form.

  • admin replied to the topic Basic Templates in the forum Template Files 8 years, 4 months ago

    style.css
    index.php
    Both of these files go into the Theme directory. The index.php template file is very flexible. It can be used to include all references to the header, sidebar, footer, content, categories, archives, search, error, and any other page created in WordPress.

  • At the very minimum, a WordPress Theme consists of two files:

  • That way, you will only have to alter the HTML and PHP code, instead of creating it all from scratch. Examples are shown below. Once you have created the Page Template and placed it in your Theme’s directory, it will be available as a choice when you create or edit a Page. (Note: when creating or editing a Page, the Page Template option does not a…[Read more]

  • What follows the above five lines of code is up to you. The rest of the code you write will control how Pages that use the Snarfer Page Template will display. See Template Tags for a description of the various WordPress Template functions you can use for this purpose. You may find it more convenient to copy some other Template (perhaps page.php or…[Read more]

  • The file may be named almost anything with a .php extension (see reserved Theme filenames for filenames you should not use; these are special file names WordPress reserves for specific purposes).

  • The above code defines this snarfer.php file as the “Snarfer” Template. Naturally, “Snarfer” may be replaced with most any text to change the name of the Page Template. This Template Name will appear in the Theme Editor as the link to edit this file.

  • The files defining each Page Template are found in your Themes directory. To create a new Custom Page Template for a Page you must create a file. Let’s call our first Page Template for our Page snarfer.php. At the top of the snarfer.php file, put the following:

  • If your Theme needs to have even more control over which Template files are used than what is provided in the Template Hierarchy, you can use Conditional Tags. The Conditional Tag basically checks to see if some particular condition is true, within the WordPress Loop, and then you can load a particular template, or put some particular text on the…[Read more]

  • You can get even more specific in the Template Hierarchy by providing a file called, for instance, category-6.php — this file will be used rather than category.php when generating the page for the category whose ID number is 6. (You can find category ID numbers in Manage > Categories if you are logged in as the site administrator in WordPress v…[Read more]

  • To use the Template Hierarchy, you basically need to provide special-purpose Template files, which will automatically be used to override index.php. For instance, if your Theme provides a template called category.php and a category is being queried, category.php will be loaded instead of index.php. If category.php is not present, index.php is used…[Read more]

  • WordPress can load different Templates for different query types. There are two ways to do this: as part of the built-in Template Hierarchy, and through the use of Conditional Tags within The Loop of a template file.

  • Load More