surfweb82 on “multiple loops and is_page”

Hello.

I have a problem with two loops on a page. Practically the two loops are working properly but I have also given in the sidebar of the texts that appear depending on the page you are viewing. However, if within the template where I set these two loops phrases do not appear.

However, if within the template where I set these two loops phrases do not appear.

However, if within the template where I set these two loops phrases do not appear.

I write the code I’m using:

code page

<?php get_header(); ?>
<div id="content">
  <div id="whitepapers">
  <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
  <?php $emphasis = get_post_meta($post->ID, 'emphasis', $single = true);?>
    <?php if ($emphasis != ""){ ?><span class="emphasis"><? echo"$emphasis"; ?></span><? }?>
    <?php $print = get_post_meta($post->ID, "print", true); ?>
     <? if($print == yes){ ?>
  <div class="docprint"><a href="#Print" onclick="window.print(); return false;" title="Click here to print."><span>Click here to print</span></a></div> <? }?>
    <h1><?php the_title(); ?></h1>
    <div class="wtxtpost"><?php the_content(); ?></div>
    <?php $typecategory = get_post_meta($post->ID, "typecategory", true); ?>
  <?php endwhile; ?>
  <?php endif; ?>
  <ul>
  <?php if(have_posts()) : ?>
    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
	$wp_query = new WP_Query();
    $wp_query->query("category_name=$typecategory&showposts=5&paged=$paged&order=DESC");
    while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
    <li>
    <h2><?php the_title(); ?></h2>
    <div class="txtpost"><?php the_content(); ?></div>
    <?php $typedoc = get_post_meta($post->ID, "object", true); $urlfile = get_post_meta($post->ID, "urlfile", true); ?>
    <? if($typedoc != ""){ ?>
  <div class="doc<? echo"$typedoc"; ?>"><a href="<? echo"$urlfile"; ?>" title="<?php the_title(); ?>"><span>download <? echo"$typedoc"; ?></span></a></div>
  <? }?>
    </li>
    <?php endwhile; ?>
  </ul>
   <div class="navigation"><?php wp_pagenavi(); ?></div>
    <?php else : ?>
    <p>No file available yet in this section</p>
    <?php endif; wp_reset_query(); ?>
  </div>
  <?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>

code sidebar

<?php } if(is_page(array(599,662,17,602))){ ?>
<div id="subnavs">
some textx
</div>
<?php } ?>
This entry was posted in Wordpress Templates and tagged div, div class, div id, PHP, quot, span class, Wordpress Templates. Bookmark the permalink. Both comments and trackbacks are currently closed.