GetSimple Support Forum

Full Version: load code if page is
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all

I've been using GS for a few months now and just love how clean and simple it is to setup easy to manage websites.

I was wondering if its possible to load a section of code in the template file if a specified page(s) are loaded.

Does anyone know if this is possible and if so how?

Thanks guys.
For one page:
PHP Code:
<?php if (return_page_slug()=='page') { ?>
... code ...
<?php ?>

For several pages:
PHP Code:
<?php if (in_array(return_page_slug(),array('page1','page2','page3'))) { ?>
... code ...
<?php ?>
Excellent! Thank you Carlos!

Its simple when you know how Smile

(2013-03-05, 06:37:07)Carlos Wrote: [ -> ]For one page:
PHP Code:
<?php if (return_page_slug()=='page') { ?>
... code ...
<?php ?>

For several pages:
PHP Code:
<?php if (in_array(return_page_slug(),array('page1','page2','page3'))) { ?>
... code ...
<?php ?>