Jump to content
Sign in to follow this  

Display custom meta from custom post types?

Recommended Posts




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.






Share this post

Link to post
Share on other sites

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.

Something big is coming for DMS + photographers.



Nick Haskins & CO - New home for all of my PageLines Store products! 



Better DMS - News, Tutorials, and Tips



Share this post

Link to post
Share on other sites

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!! 




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>
	<?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 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 class="span3">
			 <?php echo get_post_meta($postid, 'dtf_merch_buyButton', true);?> <a href="<?php the_permalink(); ?>">More Info</a>
			<div class="span4 excerpt"><?php the_content();?> 
	<?php endwhile; endif; wp_reset_query(); ?>

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  

  • Similar Content

    • tiltcreative
      By tiltcreative
      Hello, I am using anyloop on my home page. I want it to be small and just show the excerpt and title so I've chosen the grid setting. I have tried 300px, 400px, 500px in the 'Post Width (Grid Mode Only)' but it doesn't change. What am I doing wrong?
      Thanks for your help.
    • Frederic
      By Frederic
      Hi Nick,
      I am considering buying anyloop and have a few questions re what the section really does:
      1- i read you can display post types - does that mean I can have a page/postloop displaying pages instead of posts? And can I select which pages or it would be all of those published?
      2- can I have a page/postloop displaying both posts and pages?
      3- are you planning a 'popular' or most viewed shorcode for the side bar?
      That's it!
      THanks for your attention
    • fmwebdesign
      By fmwebdesign
      please have a look to our site, we use anyloop on two sites:
      In the first version there is everything Ok, we want to cut the post´s with the read more (mehr...)
      At the site "poly" we have the same edits, but there is no effect!
      What can we do?
      Thanks and best regards
    • peters_publishing
      By peters_publishing
      Hello! I'm using Anyloop with Pagelines Framework. I want to paginate the posts that don't appear on the page, but I still want to keep the content area above the posts from Anyloop. Here is a sample page: http://www.skypeenglishclasses.com/english-phrasal-verbs/