Support

Account

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

  • Hi, Kaitlyn
    thanks, but I’m not know what’s still wrong

    
    <?php 
    
    if ( is_singular( 'playlists' ) ): 
    
    	if( have_posts() ): ?>
    
    		<ul>
    			
    		<?php while ( have_posts() ) : the_post(); 
    
    			$current_id = get_the_ID(); 
    			$currentCat = get_field('categorias', $current_id);
    			if (get_field('categorias') == $currentCat): ?>
    			
    				<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 ?>