Download Docs Forums

Theo
ULTRA LIGHT CONTENT MANAGEMENT

You are not logged in.

#1 06/25/17 10:28am

Jeremy
Posts: 7

Optimize / Customize Your New Theme

Here are a few optional ways to optimize / customize your new theme.

Optimize Index - Replace PHP With HTML

Replacing bits of PHP reduces processing which speeds up delivery.
$home - If you won't be changing the Site Name, or to use a logo instead of text.
menu() - If you won't be adding any new categories.
pages() - If you won't be adding any new pages.

To get the HTML (with theme installed), open the site in a browser then right click > View Source. Find the HTML for the section to replace, then copy it to index replacing the PHP.

You may have other PHP that can be replaced. For instance if there's a copyright line with date() and $S['site'], replace with year and site name.

Replaced code won't be dynamic, so if you replaced menu() then add a category, you'll have to manually add the link to index.

Optimize Index - Compression

If your host doesn't already compress output you can add compression. To test, use a site like this one.

If your site isn't being compressed add "ob_gzhandler();" to the first line of index.php, so it looks like:

<?php ob_gzhandler(); define('THEO', 1); require 'core/config.php'; ?>
Optimize Stylesheet - Compress

Compressing saves bandwidth and speeds up delivery. There are many sites that do this for you, one example is csscompressor.com.

To decompress, use a text editor to replace "}" with "}[return]" or a site like cssunpacker.com.

Optimize Htaccess - Index Directory

You can remove a line from .htaccess if your host already denys browsing directories.

Test by removing "Options -Indexes" from .htaccess. Next open your site in a browser and navigate to the core/ folder (eg: site.com/core/). If you see the files in core/ add the line back; if not, leave the line out.

Customize Index - Meta Tags

You can add tags before or after the $head call. Examples are:

<meta name="copyright" content="Copyright owner" />
<meta name="author" content="Author name" />
<link rel="author" href="https://plus.google.com/Google Plus ID" />

This tag will make your site more mobile friendly (if doesn't include already):

<meta name="viewport" content="width=device-width, initial-scale=1">
Customize Index - Favicon!

A favicon is a small image (16x16, 32x32 etc) that shows in a browser's bookmarks and tabs.

You don't have to specify a favicon with HTML as most webservers automatically look for the file "favicon.ico".

Simply create the favicon in an image editor then drop it into the site's root folder. Pro Tip: Create your favicon in the .png format (smaller image size), then rename favicon.ico.

Customize - Site Name in Post <title>

Most sites don't use the site name in post titles, a few do. Theo only shows the site name on page titles but can be modified. This is better done as a mod vs a setting as it's less work (faster load).
In config.php change:

  $T = $R['title'].($L['cat'] ? '' : ' - '.$T);

To:

  #$T = $R['title'].($L['cat'] ? '' : ' - '.$T);
  # MOD - Site name with post titles
  $T = $R['title'].' - '.$T;

Offline

Board footer