Menu

Create themes Log in to Edit

Guillermo Martínez Jiménez

Starting a theme

Instead of starting from a blank page, it is recommendable to modify a previous one. The default GbSimple theme is the best to start as it includes all required pages and uses most of the available functions and methods.

So go to the ~/gbuser/themes/ directory, copy the gbsimple one and change it with a new name. Enter your theme directory and change the name of the file gbsimple.xml to the new name. Then open it and modify the content:

<?xml version="1.0" encoding="UTF-8"?>
<GbTheme>
  <Version>1.0</Version>
  <Name><![CDATA[Your theme name]]></Name>
  <AuthorName>Your name</AuthorName>
  <AuthorEmail>Your@email.com</AuthorEmail>
  <AuthorWebsite>http://www.yoursite.com</AuthorWebsite>
</GbTheme>

Now go to the theme manager of you Gesbit you'll see there's a new theme available. The preview screenshot is the images/gbtheme.png file.

Template files

Templates are written in PHP so you should know how to make PHP programs to modify or create themes. Also do not allow anonymous users to add or modify themes in your site as they may add malicious PHP code!

You should start with files header.php and footer.php as they're the ones that defines most headers and footers of the site. Then follow with sidebar.php and index.php and so on. All files of the GbSimple theme includes a comment explaining where the template is used.

Style and images

This section is a supposition. It needs to be confirmed!

Subdirectory style allows you to store the CSS files your theme needs. You can add all style files you want. CSS files will be added by calling:

Gb::ThemeCompleteHeader ();

The images subdirectory can be used also to store images used by your styles, as backgrounds, bullets, icons, etc. See how it is used by the .feed class in gbsimple.css.