An article by:
Posted on July 8, 2012
0

Categories: Themes , Tags: , , ,

The Luxuos theme framework allows a very easy method to create new template files, partly because it doesn’t split up the templates into separate files – each template is a self contained entity with a few php tags thrown in, so if you are comfortable in html you should have no problems :) .

The Procedure

1) Identify the template files, these are in the theme root directory and have descriptive names such as ‘Single-Column.php’, Single-Column-No-Footer.php’ etc
2) Duplicate the templates you wish to create modified versions of, and give them a suitable name
  • Open the new file(s), and modify the code at the top.. For example the ‘Single-Column.php’ contains:

    /*
    Template Name:Single-Column
    */
    
    $GLOBALS['content_width']="large"; //for portfolio use
    $GLOBALS['template']="Single-Column";
    get_header();
    Here you replace ‘Single-Column’ with the new name of the file (minus the .php extension) for example, if you named the new template ‘Single-Column-Modified.php’ you would change the code to:

    /*
    Template Name:Single-Column-Modified
    */
    
    $GLOBALS['content_width']="large"; //for portfolio use
    $GLOBALS['template']="Single-Column-Modified";
    get_header();
    The content_width global variable is just for portfolio use, it is either medium or large
    (medium for 2 column pages, large for full width).

    This template will now be automatically included by the theme and available either via the theme settings panel (such as assign a template to all posts, all pages etc) or override a specific page from that page’s edit page dropdown.

  • Leave a Reply

    • Latest Tweets