Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
include based on index
#1
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
Reply
#2
PHP Code:
<?php if (return_page_slug() == 'index') { ?>

conditional HTML goes here...

<?php ?>
Reply
#3
(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.
Reply




Users browsing this thread: 1 Guest(s)