Support » Fixing WordPress » Want image to only appear on one page not all.

  • I have an image that appears on my pages. I would like to only have it appear on the landing page.

    it is the png file to the left of the screen at http:www.chrisfawkes.net

    Right now I have this in my page template.php

    <div class="frontpage"><img alt="" class="alignnone size-full wp-image-6993" height="508" src="http://chrisfawkes.net/artprints/wp-content/uploads/2014/01/frontpage.png" width="250" />
    </div>

    then this in my css to place it where I want on the screen.

    .frontpage {
        top:0;
        position:fixed;
        z-index:100;
        _position:absolute;
        _top:expression(eval(document.documentElement.scrollTop+
            (document.documentElement.clientHeight-this.offsetHeight)));
    margin-top: 170px;
        height:25px;
    float:right;
    left:-23px;
    }

    Only issue it appears on all pages. Appreciate any help just getting it on the landing page.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Sorry, direct link to my site is http://www.chrisfawkes.net

    Peninah

    (@highlight_creative)

    I’m not seeing the picture in question, even when I look up just the picture url (using your source code)…

    check the image file Chris – it’s just a blank or transparent 250 x 508 png at the moment.

    What you need to do is use conditional tags.

    Codex

    How good are you at modifying the php files? beginner – moderate – expert?

    I’d put the php conditional tags in your theme’s page template, with a condition to display only if it’s the front page. Or, create a custom sidebar widget with the image in it.

    Thanks wire plus. I have just been playing trying to add the tag to the page.php but I must be putting it in the wrong place.

    This is my page php

    <?php get_header(); ?>
    
    <div id="content" class="">
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    
    			<div class="entry">
    				<?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>
    				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    			</div>
    
    		</div>
    		<?php endwhile; endif; ?>
    	<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?> 
    
     <div class="frontpage" ><img alt=""class="alignnone size-full wp-image-6993" height="508" src="http://chrisfawkes.net/artprints/wp-content/uploads/2014/01/frontpage.png" width="250"/>
    </div>
    	</div>
    <div class="logo"><a href="http://chrisfawkes.net/"><img alt="" class="alignnone size-full wp-image-5699" height="131" src="http://chrisfawkes.net/artprints/wp-content/uploads/2012/09/fwklogo4.png"  width="195" />
    </div>
    
    <div class="pagelink"><?php wp_link_pages('pagelink=Page %'); ?></div>

    Any heads up appreciated.

    what’s the number/pageID of the landing page?

    assuming you mean the home or default page…

    <?php get_header(); ?>
    
    <div id="content" class="">
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    
    			<div class="entry">
    				<?php the_content('<p class="serif">Read the rest of this page »</p>'); ?>
    				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    			</div>
    
    		</div>
    		<?php endwhile; endif; ?>
    	<?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?> 
    
     <?php if(is_page()){ ?><div class="frontpage" ><img alt=""class="alignnone size-full wp-image-6993" height="508" src="http://chrisfawkes.net/artprints/wp-content/uploads/2014/01/frontpage.png" width="250"/>
    </div> <?php }else{} ?><?php endif; ?>
    	</div>
    <div class="logo"><a href="http://chrisfawkes.net/"><img alt="" class="alignnone size-full wp-image-5699" height="131" src="http://chrisfawkes.net/artprints/wp-content/uploads/2012/09/fwklogo4.png"  width="195" />
    </div>
    
    <div class="pagelink"><?php wp_link_pages('pagelink=Page %'); ?></div></a>

    or just add the Page ID in is_page([page ID Number Here])

    Your image is not at http://chrisfawkes.net/artprints/wp-content/uploads/2014/01/frontpage.png or at least if it is it’s blank.

    The image is white on transparency so looks blank but shows on the dark site background, at least at my end.

    That makes sense. Will get into that later. Very much appreciate your help

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Want image to only appear on one page not all.’ is closed to new replies.