• Resolved andy-hawkins

    (@andy-hawkins)


    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="https://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="https://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: https://www.multiarena.no/wordpress/

    Hjem = Home

Viewing 4 replies - 1 through 4 (of 4 total)
  • is_home() = main posts page
    is_front_page() = your site’s front page (static or posts)

    </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="https://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="https://www.adobe.com/go/getflashplayer" />
     </div>
    <?php endif; ?>
    <!-- Include swf only for home page -->
    
    	<div id="main">

    Try this Andy.

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

    Thread Starter andy-hawkins

    (@andy-hawkins)

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Static Home Page Problem’ is closed to new replies.