• 0
Sign in to follow this  
Followers 0

AnyLoop Display custom meta from custom post types?

Question

Posted · Report post

Nick:

 

Just bought your AnyLoop plugin  -- any way to get post meta to display in a loop?

 

Like, normally I'd use the following:

 

<?php echo get_post_meta($postid, 'dtf_merch_description', true);?>

 

I'm overhauling a site and it already has so much content stored in various meta fields like the one above.

 

Thoughts?  

 

Thanks!

 

Share this post


Link to post
Share on other sites

2 answers to this question

  • 0

Posted · Report post

I can put in a few hooks for you if you want. Just let me know where you wan them. .i., after content, after post, etc.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

I ended up having to code it the way I know how.... but I may still get the gig to do a full site overhaul for this client in which case I'd rebuild this page using DMS ( I got it all the way built except the bootstrap tabs and customizing the loop that runs down the right side of the page).

 

Please keep the page private... it's not live to the fans yet!! 

 

http://www.bandofheathens.com/sunday-morning-record/

 

So, that right column is a custom post type -- the image isn't the thumbnail -- its a custom meta box, and the Buy Button that is showing is also a custom meta box.

 

The title across the top is the title... actually why not just paste the loop! Here is the loop -- (tried to clean this up.. in text mate it is sane, below the spacing got crazy...

<div class="span5 sidebar">
	<div class="row">
	  <div class="span5 header"><h3>Pre-order</h3></div>
	</div>
	<?php query_posts( array ( 'post_type' => 'store', 'cat' => '-5'));	
	if (have_posts()) : while (have_posts()) : the_post(); ?>
	<?php global $wp_query;$postid = $wp_query->post->ID ?>
		<div class="kicker"><!-- makes the bottom border and bottom padding-->
			<div class="row">
			 <div class="span5">
			   <h4><a href="<?php the_permalink();?>"><?php the_title();?></a></h4>
			 </div>	
			</div>	
			<div class="row">				
		        <div class="span5">
			  <div class="span1">
			    <a href="<?php the_permalink(); ?>"><img src="<?php echo get_post_meta($postid, 'dtf_merch_image', true); ?>"  alt ="<?php the_title(); ?>" /></a>
			</div>
			<div class="span3">
			 <?php echo get_post_meta($postid, 'dtf_merch_buyButton', true);?> <a href="<?php the_permalink(); ?>">More Info</a>
			</div>	
			</div>
			<div class="span4 excerpt"><?php the_content();?> 
                     </div>
		</div>
	</div>				
	<?php endwhile; endif; wp_reset_query(); ?>
	</div>
 </div>	
</div>

It would be wonderful to see how one would write some hooks to modify what comes out of the box & hopefully others could also benefit from the example of how to take that as the starting point and mess with it?

 

Or, instead of buying the plugin -- would it have been smarter to just create my own child theme, and then create my own section with the code above -- and just use that to build out the page?

 

 

 

Thank you thank you! 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0