“WordPress Niestandardowe zapytanie typu postu” Kod odpowiedzi

WordPress Uzyskaj niestandardowe posty typu postu

<?php 

$args = array(
    'post_type'=> 'services',
    'areas'    => 'painting',
    'order'    => 'ASC'
);              

$the_query = new WP_Query( $args );
if($the_query->have_posts() ) : 
    while ( $the_query->have_posts() ) : 
       $the_query->the_post(); 
       // content goes here
    endwhile; 
    wp_reset_postdata(); 
else: 
endif;

?>
Lucas Matheus Pena

WordPress Niestandardowe zapytanie typu postu

<?php 
    query_posts(array( 
        'post_type' => 'portfolio',
        'showposts' => 10 
    ) );  
?>
<?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;?>
Joynal Abedin

WP_Query niestandardowy typ postu

/* WordPress: Query a custom post type */

// Query all Case Study post types
<?php query_posts('post_type=case_studies'); ?>
Intra

Odpowiedzi podobne do “WordPress Niestandardowe zapytanie typu postu”

Pytania podobne do “WordPress Niestandardowe zapytanie typu postu”

Więcej pokrewnych odpowiedzi na “WordPress Niestandardowe zapytanie typu postu” w PHP

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu