Forums

[resolved] Static Home Page Problem (5 posts)

  1. Andy Hawkins
    Member
    Posted 2 years ago #

    I set up a static page for my wordpress solution. I use this solution to do it:

    Admin Area/Settings/Reading

    1) Chose A Static page
    2) set Home as my Front page
    3)... and Blog as my Posts page

    Then I tried this code to have a flash swf on my Front page:

    This is only the end of header.php

    </div><!-- #masthead -->
    	</div><!-- #header -->
    
    <!-- Include swf only for home page -->
    <?php if(is_home()): ?>
    <div id="hm_swf">
    <!-- Put here the swf code -->
    <embed src="http://www.mywebsite.no/wordpress/wp-content/flash/bannerliten.swf" quality="high" bgcolor="#ffffff" width="960" height="228" name="bannerliten" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
     </div>
    <?php endif; ?>
    <!-- Include swf only for home page -->
    
    	<div id="main">

    As you can see, this code should bring up the frontpage:

    <?php if(is_home()): ?>

    .. but my problem is that the flash swf only show up on my blog page. I recognize that my flash swf is working inside there, but why did WordPress define Blog as Home and not the actual homepage itself?

    See the site here: http://www.multiarena.no/wordpress/

    Hjem = Home

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    is_home() = main posts page
    is_front_page() = your site's front page (static or posts)

  3. MAS
    Member
    Posted 2 years ago #

    </div><!-- #masthead -->
    	</div><!-- #header -->
    
    <!-- Include swf only for home page -->
    <?php if(is_page('Hjem') || is_page('hjem')): ?>
    <div id="hm_swf">
    <!-- Put here the swf code -->
    <embed src="http://www.mywebsite.no/wordpress/wp-content/flash/bannerliten.swf" quality="high" bgcolor="#ffffff" width="960" height="228" name="bannerliten" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
     </div>
    <?php endif; ?>
    <!-- Include swf only for home page -->
    
    	<div id="main">

    Try this Andy.

  4. MAS
    Member
    Posted 2 years ago #

    Or you can try esmi's send line. It will solve your problem.

  5. Andy Hawkins
    Member
    Posted 2 years ago #

    This code helped me out:

    <?php if(is_page('Hjem') || is_page('hjem')): ?>

    ... but I know that

    is_front_page()

    ...should do the job

    Thanks to you both chinmoy and esmi :-)

Topic Closed

This topic has been closed to new replies.

About this Topic