2012-03-18, 03:51:22
2012-03-18, 06:01:50
There are two default templates in GS.
If you are familiar with building website templates, or at least html pages, just go through GS wiki, and you should easily build a GS template from scratch on your own.
There are 4 base tags you actually need:
1. show page title
2. embed page's header
3. show menu
4. show page content
easy as it sounds
If you are familiar with building website templates, or at least html pages, just go through GS wiki, and you should easily build a GS template from scratch on your own.
There are 4 base tags you actually need:
1. show page title
2. embed page's header
3. show menu
4. show page content
easy as it sounds
2012-03-18, 17:43:52
@yojoe
I would add:
5. get_footer (for plugins that embed scripts)
@conholster
I suggest you take a look at template.php's source code in some basic themes like Cardinal or the nice old Getsimple default theme.
Anyway here's a quick example.
We have a very basic html sample page:
Insert some basic template tags instead of the sample content:
Save this as template.php in its own folder (inside themes), and you're done.
Edit: Make sure you're saving it as UTF-8 without BOM.
I would add:
5. get_footer (for plugins that embed scripts)
@conholster
I suggest you take a look at template.php's source code in some basic themes like Cardinal or the nice old Getsimple default theme.
Anyway here's a quick example.
We have a very basic html sample page:
Code:
<!DOCTYPE html>
<html>
<head>
<title>Page title - Site name</title>
</head>
<body>
<strong>Site name</strong> - <a href="http://mysite/">home</a>
<hr>
<h1>Page title</h1>
<p>
Here goes the page content.
</p>
<p>
More content...
</p>
<hr>
menu:
<ul>
<!-- li elements with menu links -->
</ul>
</body>
</html>
Code:
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); } ?>
<!DOCTYPE html>
<html>
<head>
<title><?php get_page_clean_title(); ?> - <?php get_site_name(); ?></title>
<?php get_header(); ?>
</head>
<body>
<strong><?php get_site_name(); ?></strong> - <a href="<?php get_site_url(); ?>">home</a>
<hr>
<h1><?php get_page_title(); ?></h1>
<?php get_page_content(); ?>
<hr>
menu:
<ul>
<?php get_navigation(return_page_slug()); ?>
</ul>
<?php get_footer(); ?>
</body>
</html>
Edit: Make sure you're saving it as UTF-8 without BOM.