Advertisement
alchymyth

Untitled

Mar 29th, 2011
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.34 KB | None | 0 0
  1. <?php // Display this loop for the blog
  2.     } else { ?>
  3.      
  4.         <?php $count = 0; ?>
  5.                            
  6.             <?php if (have_posts()) : ?>
  7.            
  8.                 <div class="posts">
  9.                                                                                            
  10.                     <?php while (have_posts() && ($count <= 8)) : the_post(); $count++; ?>
  11.                
  12.                         <?php
  13.     $subcat = get_categories('child_of=47'); $ids47 = array('47'); foreach($subcat as $c) $ids47[] = (string)$c->term_id;
  14.      
  15.     $subcat = get_categories('child_of=4'); $ids4 = array('4'); foreach($subcat as $c) $ids4[] = (string)$c->term_id;
  16.      
  17.     $subcat = get_categories('child_of=14'); $ids14 = array('14'); foreach($subcat as $c) $ids14[] = (string)$c->term_id;
  18.      
  19.     $subcat = get_categories('child_of=5'); $ids5 = array('5'); foreach($subcat as $c) $ids5[] = (string)$c->term_id;
  20.      
  21.                         if ( in_category($ids47) ) { ?>        
  22.                             <div class="post small">
  23.                                 <div class="post-img-small-news fl"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('small'); ?></a></div>
  24.                                     <h2 class="post-title fl"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  25.                                     <div class="post-comments fr"><?php comments_popup_link('0', '1', '%'); ?></div>
  26.                                     <p class="post-meta-news fl"><?php the_time('j F Y'); ?>, In <strong><?php the_category(', '); ?></strong> | Autore <strong><?php the_author_posts_link(); ?></strong></p>
  27.                                     <p class="post-excerpt-news fl"><?php the_excerpt(); ?></p>
  28.                                 <div class="clear"></div>
  29.                             </div><!--post(small)-->
  30.                    
  31.                         <?php } elseif ( in_category($ids4) ) { ?>
  32.                             <div class="post small">
  33.                                 <div class="post-img-small-extra fl"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('small'); ?></a></div>
  34.                                 <h2 class="post-title fl"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  35.                                 <div class="post-comments fr"><?php comments_popup_link('0', '1', '%'); ?></div>
  36.                                 <p class="post-meta-extra fl"><?php the_time('j F Y'); ?>, In <strong><?php the_category(', '); ?></strong> | Autore <strong><?php the_author_posts_link(); ?></strong></p>
  37.                                 <p class="post-excerpt-extra fl"><?php the_excerpt(); ?></p>
  38.                                 <div class="clear"></div>
  39.                             </div><!--post(small)-->
  40.                    
  41.                         <?php } elseif ( in_category($ids14) ) { ?>
  42.                             <div class="post small">
  43.                                 <div class="post-img-small-libri fl"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('small'); ?></a></div>
  44.                                 <h2 class="post-title fl"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  45.                                 <div class="post-comments fr"><?php comments_popup_link('0', '1', '%'); ?></div>
  46.                                 <p class="post-meta-libri fl"><?php the_time('j F Y'); ?>, In <strong><?php the_category(', '); ?></strong> | Autore <strong><?php the_author_posts_link(); ?></strong></p>
  47.                                 <p class="post-excerpt-libri fl"><?php the_excerpt(); ?></p>
  48.                                 <div class="clear"></div>
  49.                             </div><!--post(small)-->
  50.                    
  51.                 <?php } elseif ( in_category($ids5) ) { ?>
  52.                     <div class="post small">
  53.                                             <div class="post-img-small-finzioni fl"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('small'); ?></a></div>
  54.                                             <h2 class="post-title fl"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
  55.                                             <div class="post-comments fr"><?php comments_popup_link('0', '1', '%'); ?></div>
  56.                                             <p class="post-meta-finzioni fl"><?php the_time('j F Y'); ?>, In <strong><?php the_category(', '); ?></strong> | Autore <strong><?php the_author_posts_link(); ?></strong></p>
  57.                                             <p class="post-excerpt-finzioni fl"><?php the_excerpt(); ?></p>
  58.                                             <div class="clear"></div>
  59.                                     </div><!--post(small)-->
  60.                 <?php } ?>
  61.                                    
  62.                             <?php if( $count == 4 ) : ?>
  63.                            
  64.                             </div><!--posts-->
  65.            
  66.             <div class="clear"></div>
  67.            
  68.             <div class="adv_post">
  69.                 <div class="adv_content">
  70.                     <a href="#"><img src="<?php bloginfo('template_directory'); ?>/images/468x60.jpg" alt="" width="468" height="60" /></a>
  71.                 </div>
  72.                 <div class="clear"></div>
  73.             </div>
  74.  
  75. <div class="posts">
  76.  
  77. <?php endif; //end of 'if( $count == 4 )'
  78.  
  79. endwhile; ?>
  80.             </div><!--posts-->
  81.    
  82.            
  83. there should be a '<?php endif; ?>' to close the '<?php if (have_posts()) : ?>' here at the end
  84. and the closing '<?php } ?>' for the
  85. '<?php // Display this loop for the blog
  86.     } else { ?>'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement