GetSimple Support Forum
include based on index - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Themes (http://get-simple.info/forums/forumdisplay.php?fid=10)
+--- Thread: include based on index (/showthread.php?tid=7946)



include based on index - keneso - 2016-02-11

Hi

I am trying to make make my own theme, and need a conditional snip to include an element if in homepage (index).

I know I could create two files and pick one for index, and the other for other pages, but would like to just add a snip to the template.php file.

I am not a coder so I am asking for the php code to do this.

Thank you


RE: include based on index - Carlos - 2016-02-11

PHP Code:
<?php if (return_page_slug() == 'index') { ?>

conditional HTML goes here...

<?php ?>



RE: include based on index - keneso - 2016-02-11

(2016-02-11, 04:33:07)Carlos Wrote:
PHP Code:
<?php if (return_page_slug() == 'index') { ?>

conditional HTML goes here...

<?php ?>

Thank you.

Much simpler than I thought.