Created
September 1, 2015 22:09
-
-
Save taniarascia/055e2d3bc4438b561378 to your computer and use it in GitHub Desktop.
Correct Way to Pull From a Custom Loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php get_header(); ?> | |
<?php $featured_image = wp_get_attachment_url(get_post_thumbnail_id($page->ID)); | |
if (have_posts()) : while (have_posts()) : the_post(); | |
?> | |
<div class="container" id="services_container"> | |
<img src="<?php echo $featured_image;?>" class="left_image"> | |
<div class="left_box"> | |
<h2><?php the_title();?></h2> | |
<p> | |
<?php the_content();?> | |
</p> | |
<?php endwhile; endif;?> | |
<ul> | |
<?php | |
$new = new WP_Query('post_type=services-custom&orderby=menu_order&order=ASC'); | |
while ($new->have_posts()) : $new->the_post(); | |
$meta = get_post_meta($post->ID,'_my_meta',TRUE); | |
?> | |
<li> | |
<a href="<?php echo $meta['pdf'];?>" target="_blank"> | |
<?php the_title();?> | |
</a> | |
</li> | |
<?php endwhile; ?> | |
</ul> | |
</div> | |
<div style="clear: both"></div> | |
</div> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment