Creating static page with Simple Graph

Using content tags

As of version 1.0.0, you can now use simple tag to include simple graph(s) in your posts and pages. However, this required WP2.2 or newer. If you’re using earlier versions of Simple Graph or WordPress, scroll down the page for instructions on how to do this manually.

If you want to insert a graph in posts and/or pages, simply write a string similar to following in your post or page.

Just replace the values as you wish. The ones above are default values, and if you don’t need to change the default value, you can simply omit that value from the string. I.e. alone produces the graph with default values drawn from widget setup.

The manual (old) approach

Step 1. Copy page.php to graph.php

Navigate to your theme folder and find a file called page.php. This is a template which specifies how your static pages are displayed. Copy the file to other name, for example graph.php.

Step 2. Edit your graph.php file

In your newly created graph.php file, find the position where the page entry begins. Usually it looks like this: <div class="entrytext">

Replace the contents of that div elements with something similar to the example below. This is the source code excerpt from my own weight watch page.

[html]

All measurements

Weekly averages

Last month

Read the rest of this page »

‘); ?>Pages: ‘, ‘

‘, ‘number’); ?>

[/html]

Also, don’t forget to change the template name at the beginning of the page template file, for example to “Graph Template”.

Step 3. Create a new static page

In your WordPress dashboard, go to “Write Page.” On the right-hand options column, select “Graph Template” as the Page Template. If you wish, you may enter page content, which will appear below the graph(s). And you’re done!