Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Page Array
#1
Hey all!

I am switching out subheaders (images/divs) on my interior pages with a pretty simple conditional

PHP Code:
if (return_page_slug() == 'about-us') {
echo 
'<div class="InteriorAbout">Some copy here</div>';
} else { ...} 

Client wants this to happen on more pages....can I somehow use an array with this rather than writing out a bunch of if's?

Noob bowing down!!!

Thanks!
Reply
#2
PHP Code:
if (in_array(return_page_slug(), array('about-us','another-page','yet-another-page'))) {
... 
Reply
#3
(2013-09-27, 15:46:25)Carlos Wrote:
PHP Code:
if (in_array(return_page_slug(), array('about-us','another-page','yet-another-page'))) {
... 

Much appreciated Carlos!!!! I'll give it a go!
Reply




Users browsing this thread: 1 Guest(s)