Support

Account

Home Forums General Issues Query post with get_field() Reply To: Query post with get_field()

  • Sorry, I try this, but still not work.

    
    <?php
    
    if ( is_singular( 'playlists' ) ):
    
     	$current_category = get_field( 'categorias', get_the_ID() );
    
    	if( have_posts() ): ?>
    
    		<ul>
    
    		<?php while ( have_posts() ) : the_post();
    
    			if (get_field('categorias') == $current_category): ?>
    
    				<li>
    					<a href="<?php the_permalink(); ?>">
    						<img src="<?php the_post_thumbnail('thumbnail'); ?>" />
    
    					</a>
    				</li>
    
    			<?php endif; ?>
    
    		<?php endwhile; ?>
    
    		</ul>
    
    	<?php endif; // have_post ?>
    
    <?php endif; //is_singular ?>