WordPress.org

Ready to get started?Download WordPress

Forums

is_page() producing odd results (2 posts)

  1. btard
    Member
    Posted 4 years ago #

    Here is my code, it is in the footer.php of my theme.

    I expect that the code inside will only be executed IF it is page 7 (which is my Home page). Weirdly enough, it is showing on ALL pages.

    <?php if(is_page(7)):?>
    		<script type="text/javascript">
    		<!--
    		swfobject.registerObject("FlashID");
    		//-->
    		</script>
    <?php endif;?>

    If i set it to !is_page() it works, like this:

    <?php if(is_page(7)):?>

    Any ideas why this would be acting up?

    (i have spent 14 consecutive hours on this project :)

  2. btard
    Member
    Posted 4 years ago #

    seemed to have fixed it using

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

    when the front page is changed to a post or page, this serems to be the way top go.

    you live, you learn...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags