News Update :
Home » » Request to the server according to custom fields and a post-type

Request to the server according to custom fields and a post-type

By: Unknown on Saturday, 21 February 2015 | 12:28

Just a moment, or we need to invoke Article according to custom fields. Ex .: Call all that is blue and small in there.

The first step is to create a post type and then install ACF Advanced Custom Field. Types does too, but experience ACF is Simpler to manage.

 




Consequently we will create custom fields for our Post Type.




<?php
    query_posts(array(
        'post_type' => 'evenement',
        'cat'      => 2, // La catégorie visée
        'meta_query' => array(
                array(
                    'key' => 'date', // Le champ personnalisé
                    'value' => '"19"', // La valeur désiré
                    'compare' => 'LIKE', //
       
                )
            )
    ) ); 
?>
<?php while (have_posts()) : the_post(); ?>
        <h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
        <p><?php echo get_the_excerpt(); ?></p>
<?php endwhile;?></li>
 
Contact Us | Privacy policy | Term of use | Advertise with Us | Site map
Copyright © 2011. Blogging Brain . All Rights Reserved.
Design Template by Blogging Brain | | Powered by Blogger