Forums

Account Manager, Project Manager, Writer, Muslim, Father, Entrepreneur, Cook

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 74 total)
  • Author
    Posts
  • in reply to: Special Template Files #1581
    Nadir Keval
    Keymaster

    Similarly, if the user clicks on a link for a particular category, WordPress will use the category.php template if it exists; if it doesn’t, it looks for archive.php, and if that template is also missing, WordPress will go ahead and use the main index.php template. You can even make special template files for specific categories (see Category Templates for more information).

    in reply to: Special Template Files #1580
    Nadir Keval
    Keymaster

    WordPress automatically recognizes template files with certain standard names and uses them for certain types of web pages. For example, when a user clicks on the title of a blog post, WordPress knows that they want to view just that article on its own web page. The WordPress template hierarchy will use the single.php template file rather than index.php to generate the page — if your Theme has a single.php file.

    in reply to: Special Template Files #1579
    Nadir Keval
    Keymaster

    You can use the index.php template file to generate all of these types of pages or rely on WordPress’ template hierarchy to choose different template files depending on the situation.

    The WordPress Template Hierarchy answers the following question:

    in reply to: Special Template Files #1578
    Nadir Keval
    Keymaster

    The multi-post view lists multiple posts or post summaries, and applies to category archives, date archives, author archives, and (usually) the “normal” view of your blog’s home page.

    in reply to: The required style.css file #1576
    Nadir Keval
    Keymaster

    After you have created the child theme you must then enable it through the Administration Panels > Appearance > Themes. You should see your child theme as a separate theme and should bear the name you gave it in the style.css under Theme Name. Just creating a child theme will not activate it and make it visible on your website. Note that a child theme’s stylesheet replaces the stylesheet of the parent completely. (

    in reply to: The required style.css file #1575
    Nadir Keval
    Keymaster

    Author. (optional) Author name.
    Author URI. (optional) Author webpage.
    Template. (required) directory name of parent theme, case-sensitive.
    NOTE. You have to switch to a different theme and back to the child theme when you modify this line.

    in reply to: The required style.css file #1574
    Nadir Keval
    Keymaster

    A quick explanation of each line:

    Theme Name. (required) Child theme name.
    Theme URI. (optional) Child theme webpage.
    Description. (optional) What this theme is. E.g.: My first child theme. Hurrah!

    in reply to: The required style.css file #1573
    Nadir Keval
    Keymaster

    Here is an example information header of a child theme’s style.css:

    /*
    Theme Name: Twenty Twelve Child
    Theme URI: http://example.com/
    Description: Child theme for the Twenty Twelve theme
    Author: Your name here
    Author URI: http://example.com/about/
    Template: twentytwelve
    Version: 0.1.0
    */

    in reply to: The required style.css file #1572
    Nadir Keval
    Keymaster

    As with any WordPress theme, the information header must be at the top of the file, the only difference being that in a child theme the Template: line is required, so that WordPress knows which theme is the parent of the child theme.

    in reply to: Child Themes #1570
    Nadir Keval
    Keymaster

    A child theme resides in its own directory in wp-content/themes. The scheme below shows the location of a child theme along with its parent theme (Twenty Twelve) in a typical WordPress directory structure:

    in reply to: Child Themes #1569
    Nadir Keval
    Keymaster

    For this reason, child themes are the recommended way of making modifications to a theme.

    With a basic understanding of PHP, WordPress Templates, and the WordPress Plugin API, you can make the child theme extend virtually every aspect of a parent theme, and again, without actually changing the parent theme files.

    in reply to: Child Themes #1568
    Nadir Keval
    Keymaster

    The child theme contains a “Template: parent-theme-dir” header to distinguish it from standalone themes. With a little understanding of HTML and CSS, you can make that very basic child theme modify the styling and layout of a parent theme to any extent without editing the files of the parent theme itself. That way, when the parent theme is updated, your modifications are preserved.

    in reply to: Child Themes #1567
    Nadir Keval
    Keymaster

    Making a child theme is very simple. Create a directory by using FTP or whatever file management application your host provides. Put a properly formatted style.css file in it, and you have a child theme!

    in reply to: Anatomy of a Theme #1565
    Nadir Keval
    Keymaster

    The optional functions file (functions.php) as part of the WordPress Theme files.
    Let’s look at these individually.

    in reply to: Anatomy of a Theme #1564
    Nadir Keval
    Keymaster

    WordPress Themes typically consist of three main types of files, in addition to images and JavaScript files.

    The stylesheet called style.css, which controls the presentation (visual design and layout) of the website pages.
    WordPress template files which control the way the site pages generate the information from your WordPress database to be displayed on the site.

Viewing 15 posts - 1 through 15 (of 74 total)
Back to top