Thank you very much, guys!
I’m using this posts-in-page plugin now, and I want to show four posts in the page. The “tag” property it’s not working for me… So, I’m trying to use this shortcode: [ic_add_posts showposts=’4′]
It’s ok, and working, but I want to create a different div css to each post (I’ll use different background’s color) and I don’t know how to do it…
It seems to me that in this function the post loop is called:
protected function add_template_part( $ic_posts, $singles=false ) {
if ( $singles ) {
setup_postdata( $ic_posts );
} else {
$ic_posts->the_post( );
}
$output = '';
ob_start( );
$output .= apply_filters( 'posts_in_page_pre_loop', '' );
require ( $file_path = self::has_theme_template( ) )
? $file_path // use template file in theme
: POSTSPAGE_DIR . '/posts_loop_template.php'; // use default plugin template file
$output .= ob_get_contents( );
$output .= apply_filters( 'posts_in_page_post_loop', '' );
return ob_get_clean( );
}
and this posts_loop_template.php page, has this code:
<!-- NOTE: If you need to make changes to this file, copy it to your current theme's main
directory so your changes won't be overwritten when the plugin is upgraded. -->
<!-- Start of Post Wrap -->
<div class="post hentry ivycat-post">
<!-- This is the output of the post TITLE -->
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<!-- This is the output of the EXCERPT -->
<div class="entry-summary">
<?php the_excerpt(); ?>
</div>
<!-- This is the output of the META information -->
<div class="entry-utility">
<?php if ( count( get_the_category() ) ) : ?>
<span class="cat-links">
<?php printf( __( '<span class="%1$s">Palavras-chave:</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?>
</span>
<?php endif; ?>
<?php
$tags_list = get_the_tag_list( '', ', ' );
if ( $tags_list ):
?>
<span class="tag-links">
<?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyten' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
</span>
<span class="meta-sep">|</span>
<?php endif; ?>
<?php
$posts_loop_template_counter++;
edit_post_link( __( 'Edit', 'twentyten' ), '<span class="meta-sep">|</span> <span class="edit-link">', '</span>' ); ?>
</div>
</div>
<!-- // End of Post Wrap -->
How could I insert a customized “<div id=’$counter’>” or something like that? The problem is that I don’t know where I would increment the $count…