Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP on Thesis for WP, if else else statement
Old 12-22-2009, 11:38 AM PHP on Thesis for WP, if else else statement
Kuper's Avatar
Junior Talker

Posts: 2
Name: Ryan
Trades: 0
Hello everyone my Name is Ryan though I am more commonly know as Kuper. I am young guy who is starting to work his way into the world of being a webmaster. Having said that Christmas has not come around and I have I do not have the money to buy that PHP book I have been dieing and needing to get. I come here to ask for some help and guidance as I learn. All of that being said I have a friend to the family seeking my help and as much as I am helpful to him on the HTML side of his site, he asked about PHP and all I can do is sit on my thumb as guess.

Moving to the point he is running a wordpress THESIS (theme) blog with multiple pages. He has a banner for every page (5 pages total) but they all show up on every page one right under the other. He asked WP and THESIS and he was told he needs a if else else statement to correct this issue. I have a simple idea of what needs to be said in the code but again not knowing PHP (yet) I have no idea how to write it.

At the end of the day all I am asking for is some idea anyone can give me as to how to write this out in code, anything I can use to give it a test and figure it out from there. More than anything I need the starter; fair enough? Can anyone please help me??

Happy holidays
Kuper
Kuper is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-22-2009, 01:22 PM Re: PHP on Thesis for WP, if else else statement
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Code:
<?php
If(condition to test){
  do some stuff here if condition tested is true
} else {
  do some stuff here if condition tested is false
}
?>
That's the basic if else. It's hard to know what to tell you more specifically, because I'm not entirely sure what you want to do. I understand the basic idea, but the details aren't known.

It's possible and even likely that you can use WordPress conditional tags instead of directly using php.

If you want to describe in more detail what you're trying to do, I'm sure we can provide something more specific as an answer.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 12-22-2009, 02:05 PM Re: PHP on Thesis for WP, if else else statement
Kuper's Avatar
Junior Talker

Posts: 2
Name: Ryan
Trades: 0
They best way I could tell you what I am trying to do is maybe to show you what has gone wrong. Here is the site I am working with and as you may very well see there are different pages (about, contact, archives, etc) We have managed to get the banners in the right place but they are all showing on ever page instead of just on each banner's respective page.

From my basic knowledge of PHP and if else usage I would describe it as

IF page = "index" IMG = banner1
ELSE Page = "About" IMG = Banner2
ELSE Page = "Contact" IMG = Banner3

That said this is not MPI and I am not on a MU* so I doubt that plain English is going to go over to well, then again I have a basic, less than W3Schools, understanding of PHP as I have stated.

I am thankful for your help on this while I try myself to even begin to understand what I am doing.
__________________
In running all animals soon after they start get out of breath, but as the body becomes heated, breathing becomes more easy and endures until fatigue produces exhaustion; this is called the second wind.
Kuper is offline
Reply With Quote
View Public Profile
 
Old 12-22-2009, 04:11 PM Re: PHP on Thesis for WP, if else else statement
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
Starting from your example, a syntax correct solution could be

PHP Code:
// assuming the $page variable is set
if ($page == "page1") {
   
$img "banner1.png";
} elseif (
$page == "page2") {
   
$img "banner2.png";
} elseif (
$page == "page3") {
   
$img "banner3.png";
}
// and so on
else {
   
$img "default.png";
}


// where the banner is output
echo "<img src=\"path/to/images/$img\">"
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.

Last edited by lizciz; 12-22-2009 at 04:12 PM..
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Reply     « Reply to PHP on Thesis for WP, if else else statement
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.35260 seconds with 12 queries