Support » Fixing WordPress » custom post types and get_pages arguments dumb question

  • I am trying to pull content from my custom post type ‘products’ into my home page using get_pages()

    I am using the following code from the codex, but I must be doing something wrong with the arguments for get_pages because my posts aren’t being pulled.

    Is this the right way to use the post_types argument?

    <?php
    	$mypages = get_pages('post_type=product');
    	$count = 0;
    	foreach($mypages as $page)
    	{
    		$content = $page->post_content;
    		if(!$content)
    			continue;
    		if($count >= 2)
    			break;
    		$count++;
    		$content = apply_filters('the_content', $content);
    	?>
    		<h2><a href="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title ?></a></h2>
    		<div class="entry"><?php echo $content ?></div>
    	<?php
    	}
    ?>

    J

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘custom post types and get_pages arguments dumb question’ is closed to new replies.