WP Query showing Complex Query

<?php
$args = array(
‘post_type’ => ‘crafts’,
‘order’    => ‘DESC’,
‘showposts’=> 1
);
query_posts($args);
?>
<?php $posts = get_posts(‘post_type=crafts&numberposts=1&offset=0’); foreach ($posts as $post) : start_wp(); ?>
<?php /* static $count1 = 0; if ($count1 == “1”) { break; } else { */ ?>
background-image:url(<?php echo get_post_meta($post->ID, “crafts_image”, true); ?>)”>

<h1><?php the_title(); ?></h1>
<p><?php echo get_post_meta($post->ID, “crafts_excerpt”, true); ?></p>
href=”<?php echo get_the_permalink(); ?>”><?php echo get_post_meta($post->ID, “crafts_link_text”, true); ?>

<?php endforeach; ?>

<?php
$args = array(
‘post_type’ => ‘crafts’,
‘order’    => ‘DESC’,
‘showposts’=> 4
);
query_posts($args);
?>
<?php $posts = get_posts(‘post_type=crafts&numberposts=4&offset=1’); foreach ($posts as $post) : start_wp(); ?>
<?php static $count1 = 0; if ($count1 == “4”) { break; } else {  ?>
<div class=”col-sm-3 pswrp”>
<h2><?php the_title(); ?></h2>
<p><?php echo get_post_meta($post->ID, “crafts_excerpt”, true); ?></p>
href=”<?php the_permalink(); ?>”><?php echo get_post_meta($post->ID, “crafts_link_text”, true); ?>

<?php $count1++; } ?>
<?php endforeach; ?>

Advertisements

Published by

oudarya

I am a developer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s