Support

Account

Home Forums Front-end Issues Post object inside custom post type

Unread

Post object inside custom post type

  • I have created a Custom Post Type called ‘faqs’ and inside each post is a ACF post object where you choose which pages the post appears on….easy so far!

    What I’m struggling with is getting them to appear, I either get all the posts or none…

    I’ve tried the following;

    <?php
        $args = array(
            'post_type'=> 'faqs',
            'orderby' => 'title',
            'order' => 'ASC',
            'post_status' => array('publish'),
            'posts_per_page'=>'999',
            'meta_query'		=> array(
    			array(
    				'key' => 'services_sections'
    			)
    		)
        );
        query_posts( $args ); 
        while (have_posts()){ the_post(); 
    ?>	
    	<h3><?php the_title(); ?></h3>	
    <?php } ?>

    and

    <?php if( have_rows('services_sections') ): ?>          
        <?php while( have_rows('services_sections') ): the_row(); ?>    
            
    		<?php
    		    $args = array(
    		        'post_type'=> 'faqs',
    		        'orderby' => 'title',
    		        'order' => 'ASC',
    		        'post_status' => array('publish'),
    		        'posts_per_page'=>'999',
    		        // 'paged' => get_query_var('paged')
    		    );
    		    query_posts( $args ); 
    		    while (have_posts()){ the_post(); 
    		?>	
    			<h3><?php the_title(); ?></h3>	
      		<?php } ?>
    
        <?php endwhile; ?>
    <?php endif; ?> 
    <?php wp_reset_query(); ?>

    Neither seem to work, I don’t think it’s overly complicated but no success…any ideas?

Viewing 1 post (of 1 total)

The topic ‘Post object inside custom post type’ is closed to new replies.