Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/05/2013, 15:59
juanpulag
 
Fecha de Ingreso: junio-2012
Ubicación: Medellin
Mensajes: 6
Antigüedad: 11 años, 10 meses
Puntos: 0
Pregunta Asignar clase al primer post desde PHP

Primero que todo agradecer por adelantado la orientación que me puedan dar al respecto.

Les cuento. tengo una sección del sitio en WP que muestra 3 post, desde PHP esos post tienen una clase predeterminada (newsItem), lo que necesito es que cada uno de ellos tenga diferente clase para modificar luego su apariencia desde PHP.

les adjunto la porción de código que controla esa sección.

Mil gracias nuevamente.

-jd


Código:
<h1>Expert Views &amp; Commentary</h1>

			<?php $sdac_query = new WP_Query("cat=464&showposts=12"); $i = 0; if ($sdac_query->have_posts()) : while ($sdac_query->have_posts()) : 
			$sdac_query->the_post();$i++; if( $post->ID == $postID1 ||  $post->ID == $postID2 || $post->ID == $postID3 ||  $post->ID == $postID4 || 
			$post->ID == $postID5 || $post->ID == $postID6 || $post->ID == $postID7 || $post->ID == $postID8 || $post->ID == $postID9 || $post->ID == $postID10) 
			continue; update_post_caches($posts);?>
			<?php if ($i == '1' || $i == '2' || $i == '3' ) :?>
				<div class="newsItem">
					<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
					<?php //if (function_exists('tweetmeme')) echo tweetmeme();?>
					<?php //if (function_exists('tm_generate_button')) { echo tm_generate_button(); } ?>
<?php //echo '<iframe src="http://getmailcounter.com/mailcounter/?url=';urlencode(the_permalink());echo '&title=';urlencode(the_title()); echo '" height="64" width="50" align="right" frameborder="0" scrolling="no" ></iframe>'; ?> 						

<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>
<script type="IN/Share" data-url="<?php the_permalink() ?>" data-counter="top"></script>

			<?php if (function_exists('fbshare_manual')) echo fbshare_manual(); ?>
<div style="float:right; margin-left:10px;">
<a href="https://twitter.com/share" class="twitter-share-button" data-text="<? the_title() ?>" data-url="<?php the_permalink() ?>" data-via="NSAmericas" data-lang="en" data-related="anywhereTheJavascriptAPI" data-count="vertical">Tweet</a>							
</div>

					<?php the_content('Read More &raquo;');?>
				</div>
				<?php else: ?>
				<?php endif;endwhile;?>	
				
					<h4 class="blueBG"><a href="<?php bloginfo('url');?>/category/expert-views-commentary/">Read More Expert Views &amp; Commentary &raquo;</a></h4>
				</div>
			<?php endif;?>