Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Header configuration & styling »

Inspired by a post on this forum...


  #1  
Old Aug 20, 2012, 09:58 AM
Jumpy
 
4 posts · Aug 2012
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!
  #2  
Old Aug 20, 2012, 11:47 AM
juggledad's Avatar
juggledad
 
23,667 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Aug 20, 2012, 12:30 PM
Jumpy
 
4 posts · Aug 2012
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?
  #4  
Old Aug 21, 2012, 09:24 PM
Jumpy
 
4 posts · Aug 2012
Anyone?
  #5  
Old Aug 22, 2012, 03:45 AM
juggledad's Avatar
juggledad
 
23,667 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
did you try something? if so what is the code you tried?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #6  
Old Aug 22, 2012, 04:11 AM
Jumpy
 
4 posts · Aug 2012
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?
  #7  
Old Aug 22, 2012, 04:25 AM
juggledad's Avatar
juggledad
 
23,667 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
I gave you some code, did you try looking up the syntax? try 'php if w3schools' in a google search
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Atahualpla Theme Doesn't Allow the Post Publishing after instaling Simple Press Forum Ahmad Plugins & Atahualpa 1 Apr 5, 2012 06:14 PM
WP Forum + Atahualpa: User cannot see the forum Janine Plugins & Atahualpa 7 Jan 25, 2010 09:39 AM
Stop! Don't post in the 'HOW TO' forum if.... paulae Forum How-To 4 Oct 19, 2009 12:12 PM
[SOLVED] Cannot post request in donor forum ldsmedia Customization, Design, Programming... 12 Aug 4, 2009 12:34 AM


All times are GMT -6. The time now is 04:38 AM.


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