Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
load code if page is
#1
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.
Reply
#2
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 ?>
Reply
#3
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 ?>
Reply




Users browsing this thread: 2 Guest(s)