This is what I have, and I need each of these blocks to pull the link, title of each blog post, and featured image they're supposed pull. Do you see the error?
<div class="home-featured-block">
<?php
$featured_block=$profitmag_settings['featured_block_one'];
$no_of_block=$profitmag_settings['no_of_block_one'];
$query1=new WP_Query( 'cat='.$featured_block.'&posts_per_page='.$no_of_block );
if( $query1->have_posts() ):
$cat_name = get_cat_name( $featured_block );
?>
<h2 class="block-title"><span class="bordertitle-red"></span><?php echo $cat_name; ?></h2>
<div class="feature-post-wrap clearfix">
<?php
$count = 0;
while( $query1->have_posts() ):
$query1->the_post();
$count++;
?>
<div class="featured-post clearfix">
<figure class="post-thumb clearfix">
<?php
if( has_post_thumbnail() ):
$post_thumb = wp_get_attachment_image_src( get_post_thumbnail_id(), 'three-col-thumb' );
?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><img src="<?php echo $post_thumb[0]; ?>" alt="<?php the_title_attribute(); ?>" title="<?php the_title_attribute(); ?>" /></a>
<?php
endif;
?>
</figure>
<div class="post-desc clearfix">
<h3 class="feature-main-title"><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" ><?php the_title(); ?></a></h3>
<div class="post-date feature-main-date"><i class="fa fa-calendar"></i><?php echo get_the_date( 'F d, Y') ; ?></div>
</div>
</div>
<?php
if($count % 3 == 0) echo "<div class='clear'></div>";
endwhile;
endif;
wp_reset_postdata();
?>
</div>
</div>
Aucun commentaire:
Enregistrer un commentaire