1 (edited by kanenses 2014-03-24 13:17:01)

Topic: Usage of if statement different css class

Hi all,

How can I use the if statement for change class of header class from homepage to diferent of other pages?

<?php
function specific_bgpages(){
if(is_home())        
echo '<header>';
elseif(is_page() )   
echo '<header  class="bgpages">';
}
add_action('genesis_header', 'specific_bgpages');
?>

I have try the code above but not work.
Nothing to.

Please help me smile

This code from work:

<?php
function specific_bgpages() {
  if(is_pre_content())        
    echo '<header>';
  elseif(is_post_content() )   
    echo '<header  class="bgpages">';
}
Action::add('genesis_header', 'specific_bgpages');
?>

and this to:

 <?php 
          function specific_bgpages(){ 
               if(is_home()){
                    echo '<header>'; 
               } elseif(is_page()){
                    echo '<header  class="bgpages">'; 
               } 
           }
?> 

from forum help topic I have post at http://www.webhostingtalk.com/showthrea … ost9056876

Re: Usage of if statement different css class

I have ask for help at
http://stackoverflow.com/questions/2259 … es#tab-top

Tamil Selvan have help me smile I missing the call for action

Action::add('genesis_header', 'specific_bgpages');

The code work but nothing appens.

The load code for

is_home() and is_page()

is not the correct, for home and rest of pages want is the call?

Thank you

Re: Usage of if statement different css class

Please guys any can help me? How Monstra define the homepage and the others pages?

smile

4 (edited by kanenses 2014-03-24 13:49:31)

Re: Usage of if statement different css class

More easy, tottaly forget the possibility for assign diferent pages to each page smile By assign diferent Templates smile:

http://awesomescreenshot.com/0ec2je7je6

http://awesomescreenshot.com/0962je8hb7

Thank you,

But in case how it call the home and others page at monstra?

5 (edited by VitiaM 2014-06-22 18:23:23)

Re: Usage of if statement different css class

Thank you very much, for this sharing smile
______________
метални решетки, vrati, пощенски кутии