Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Header configuration & styling (http://forum.bytesforall.com/forumdisplay.php?f=15)
-   -   Inspired by a post on this forum... (http://forum.bytesforall.com/showthread.php?t=18209)

Jumpy Aug 20, 2012 09:58 AM

Inspired by a post on this forum...
 
Hi.

I was inspired by a post on this forum, being able to show something different based on a certain page:

Code:

<?php if ( is_page('A_PAGE') ) { ?>
<!-- Something -->
<?php } ?>

However, i am trying to figure out to use the above on different pages, such as a Else case like

Code:

<?php if ( is_page('A_PAGE') ) { ?>
<!-- Something -->
<?php } ?>
<?php if ( is_page('ANOTHER_PAGE') ) { ?>
<!-- Something -->
<?php } ?>

But only then in one strict code, up to 8 pages. Is anyone here know what i mean and able to answer my question? Basicly in a wordpress layout i am trying to show different CSS headers on different pages, in one code. Thx!

juggledad Aug 20, 2012 11:47 AM

You should use an IF/ELSE combination

if (x = a) {do something;}
elseif (x = 'b') {do something else;}
elseif (x = 'c') {do something else;}
else {do the default thing;}

you can find the exact syntax via google

Jumpy Aug 20, 2012 12:30 PM

I'm not that expert with PHP, but i do understand something about it.

Do you happen to have a example code of what i posted above?

Jumpy Aug 21, 2012 09:24 PM

Anyone? :confused:

juggledad Aug 22, 2012 03:45 AM

did you try something? if so what is the code you tried?

Jumpy Aug 22, 2012 04:11 AM

All i have is the above code, from which was inspired on some topic here.

I dont know how exactly, but i'm trying to work with ELSE state, like if a page is not this then do that, i need this to show different headers each page. Does anyone know the ideal sollution?

juggledad Aug 22, 2012 04:25 AM

I gave you some code, did you try looking up the syntax? try 'php if w3schools' in a google search


All times are GMT -6. The time now is 12:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.