Jump to content

Need help with basic newb php syntax


bgbs

Recommended Posts

Ok, so Im using if else in WP

<?php
if ( is_home() ) {
    // This is a homepage
} else {
<!-- header image -->
<div class="dynamic-header"><?php if(function_exists('show_media_header')){ show_media_header(); } ?></div>
<!-- /header image -->
}
?>   

What I'm trying to do is load dynamic header banner on other pages except for home page.  But I know I can't call php within php, so how do I properly wrap the code after else statement?

 

Thanks in advance

 

 

Link to comment
https://forums.phpfreaks.com/topic/283906-need-help-with-basic-newb-php-syntax/
Share on other sites

1) I do not know why you are using is_home or isnot_home or whatever to make a condition in this case. Using a session_id should be easier.

 

2) I do not know whether your is_home is a assigned variable or a link to a page. If its a variable, it should be, if ($is_home) { blahblah ... }

or if (!$is_home) { blahblah } else { //is_home

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.