Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am a compete beginner with Advanced Custom Fields. I would like to get your help in understanding acf well, most probably a simple question.

I have a blog I use acf to categorize the posts. I use radio buttons to chose the category and the wordpress default WYSIWYG editor for the content. For example, the post categories are: sub categories are indexed:

Post type: article

field name : post_categories

Type : Radio Button



Type: Text SubHeading Type: Image Post Image

Please help me get to know how to,
1. Get Latest 3 articles from each Category.
2. In the latest 3 categories, how to include a text that looks like, 'posted in (subcategory) under (category)'.
3. How to include the subheading ?? can i just use 'the_field('SubHeading');' ???
can use any text case. much thanks from the bottom of my heart for the help.

my code is as follows

// args
$args = array(
    'numberposts' => -1,
    'post_type' => 'article',
    'meta_query' => array(
    'relation' => 'OR',
    'key' => 'internet',
    'value' => 'CSS',
    'compare' => 'LIKE'
   'key' => 'programming',
   'value' => 'ObjectiveC',
   'compare' => 'LIKE'
// get results
$the_query = new WP_Query( $args );
// The Loop
<?php if( $the_query->have_posts() ): ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
     <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query();  // Restore global post data stomped by the_post(). ?>

thank you!

share|improve this question

closed as off-topic by Pieter Goosen, birgire, G. M., Pat J, Johannes Pille Aug 15 at 13:00

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic." – Pieter Goosen, birgire, G. M., Pat J, Johannes Pille
If this question can be reworded to fit the rules in the help center, please edit the question.