• Resolved loldblog

    (@loldblog)


    Hi, I am new to word press I have been doing a ton of searches and still not get any of the options I have found to work. So I am hoping someone can help me.
    I would like to hide a specific div on all pages expect I want it to show on the home page.

    Any suggestions would be much appreciated here is what I have.

    <? php function meteor_slideshow() { if (is_front_page() ) { ?>)
    
    <div id="meteor-slideshow">
    <?php if (  is_front_page( 'meteor_slideshow' ) ) { meteor_slideshow( 
    
    "MainSlideshow"); } ?>
    </div><?php
    }
    } ?>

    CSS:
    #meteor-slideshow {
    background-color: #FFF;
    border: medium solid #000;
    margin-top: 15px;
    margin-right: auto;
    margin-bottom: 0px;
    margin-left: auto;
    width: 930px;
    position: relative;
    padding: 5px;
    }

Viewing 9 replies - 1 through 9 (of 9 total)
  • I can’t see anything wrong with the above code snippet.

    Thread Starter loldblog

    (@loldblog)

    When I put that in the page.php it gives me this error

    Parse error: syntax error, unexpected T_FUNCTION /page.php on line 16

    any thoughts

    Try:

    <?php function meteor_slideshow();
    if (is_front_page() ) :?>
    <div id="meteor-slideshow">
    <?php if (  is_front_page( 'meteor_slideshow' ) )  meteor_slideshow( "MainSlideshow"); ?>
    </div>
    <?php endif;?>
    Thread Starter loldblog

    (@loldblog)

    Still getting the same error 🙁

    I can’t see any errors in the code I posted above.

    what is the purpose of this line:
    function meteor_slideshow(); ?

    also ‘is_front_page()‘ does not use any parameter;
    http://codex.wordpress.org/Function_Reference/is_front_page

    you possibly only need to use this code:

    <?php if ( is_front_page() ) : ?>
    <div id="meteor-slideshow">
    <?php  meteor_slideshow( "MainSlideshow" ); ?>
    </div>
    <?php endif; ?>

    what is the purpose of this line:
    function meteor_slideshow(); ?

    Shoot! Missed that! Perhaps it’s meant to be an if(function_exists('')) conditional?

    Thread Starter loldblog

    (@loldblog)

    Thank you

    <?php if ( is_front_page() ) : ?>
    <div id="meteor-slideshow">
    <?php  meteor_slideshow( "MainSlideshow" ); ?>
    </div>
    <?php endif; ?>

    got it to work right.

    Thread Starter loldblog

    (@loldblog)

    Forgot to resolve.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Hide a Div tag on all but the home page’ is closed to new replies.