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
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.