• Hi all,

    i’m just getting started with wordpress but i’m facing a problem i can’t resolve by myself, because i’m absolutely not known to PHP.

    I want do display something just on page 1, the front page so i put this in my code:

    <?php if(!is_paged()) { ?>
    		test
    	<?php } ?>

    I know that this should be valid because it is already used in this way on the top of the index.php and there it works, but on the place (behind the posts) where i want to use it, it doesn’t work, if i put it in front of the posts it works.

    This is how my index currently looks like (its basically the arthemia theme)

    <?php get_header(); ?>
    
    	<?php if(!is_paged()) { ?>
    <div id="page-contenttop" class="clearfloat">
    	<div id="top" class="clearfloat">
    
    		<div id="headline">
    		<?php query_posts("showposts=1&category_name=Headline"); ?>
    		<?php while (have_posts()) : the_post(); ?>
    
    	<div class="title"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></div>
    	<div class="meta"><?php the_time('j M Y') ?> | <?php comments_popup_link('No Comment', 'One Comment', '% Comments');?> | <?php if(function_exists('the_views')) { the_views(); } ?></div>
    	<?php $values = get_post_custom_values("Headline");?>
     	<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
    <img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php
    $values = get_post_custom_values("Image"); echo $values[0]; ?>&w=130&h=161&zc=1&q=100"
    alt="<?php the_title(); ?>" class="left" width="130" height="161"  /></a><?php the_excerpt(); ?><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Read the full story &raquo;</a>
    	<?php endwhile; ?>
    		</div>
    
    	<div id="featured"><div class="featureimg">
     	<?php query_posts("showposts=3&category_name=Featured"); $i = 1; ?>
    
          	<?php while (have_posts()) : the_post(); ?>
    	<div class="box"><div class="clearfloat">
    	<?php $values = get_post_custom_values("Image");
    	if (isset($values[0])) { ?>
          <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
    	<img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php
    $values = get_post_custom_values("Image"); echo $values[0]; ?>&w=68&h=58&zc=1&q=100"
    alt="<?php the_title(); ?>" class="left" width="68" height="58"  /></a>
          <?php } ?>
    	<div class="info"><a href="<?php the_permalink() ?>" rel="bookmark" class="title"><?php the_title(); ?></a>
    <div class="meta"><?php the_time('j M Y') ?> | <?php comments_popup_link('No Comment', 'One Comment', '% Comments');?> | <?php if(function_exists('the_views')) { the_views(); } ?></div>	</div>
    
    </div>
    
       	</div>
    
    <?php endwhile; ?></div>
    
    	</div>
    
    </div>	</div>
    
    	<?php } ?>
    
    <div class="cont_background">
    
    	<div id="bottom" class="clearfloat">
    
    	<div id="front-list">
    
    	<?php
          $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
          query_posts("cat=-11,-15&paged=$page&posts_per_page=5"); ?>
    
    	<?php while (have_posts()) : the_post(); ?>
    
    	<div class="clearfloat">
    	<div class="title"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></div>
    	<div class="meta"><?php the_category(', '); ?> | <?php the_time('j M Y') ?> | <?php comments_popup_link('No Comment', 'One Comment', '% Comments');?> | <?php if(function_exists('the_views')) { the_views(); } ?></div>
    
    	<div class="spoiler">
    	<?php	$values = get_post_custom_values("Image");
    	if (isset($values[0])) { ?>
          <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
    	<img src="<?php echo bloginfo('template_url'); ?>/scripts/timthumb.php?src=/<?php
    $values = get_post_custom_values("Image"); echo $values[0]; ?>&w=110&h=110&zc=1&q=100"
    alt="<?php the_title(); ?>" class="left" width="110" height="110"  /></a>
          <?php } ?>
    
    	<?php the_excerpt(); ?><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">Read more &raquo;</a>
    	</div>
    
    	</div>
    
          <?php endwhile; ?>
    
    <!-- THIS SHOULD ONLY BE DISPLAYED ON MAIN PAGE -->
    	<?php if(!is_paged()) { ?>
    		test
    	<?php } ?>
    
    	<div class="navigation">
    		<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
    			else { ?>
    
    			<div id="nextlink" class="right"><?php next_posts_link('Next Page &raquo;') ?></div>
    			<div id ="previouslink" class="left"><?php previous_posts_link('&laquo; Previous Page') ?></div>
    			<?php } ?>
    
    	</div>
    
    	</div>
    
    	<?php get_sidebar(); ?>
    
    	</div>
    
    </div>
    
    <?php get_footer(); ?>

    I would be really happy if anybody could tell me why that doesn’t work?

    with best regards,
    nemedy

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Problem with !is_paged()’ is closed to new replies.