[Resolved] Different posts loops

Home Forums Support [Resolved] Different posts loops

Home Forums Support Different posts loops

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #479829
    Luizik

    Hello there!
    First of all, thank you very much for you excellent plugin!
    Could you help me please.
    I want to show posts from different categories on different pages in the same layout i made it in Appearance->Blog.
    How can I do it.
    I am sorry? I am not strong in coding.

    #479908
    Luizik

    WP-SHOW-POST do not allow to add custom fields to pages.
    I used this code to show posts from category 5

    
    <?php
    // задаем нужные нам критерии выборки данных из БД
    $args = array(
    	'cat' => 5,
    	'orderby' => 'comment_count',
    'post_type' => 'page'
    );
    
    $query = new WP_Query( $args );
    
    // Цикл
    if ( $query->have_posts() ) {
    	while ( $query->have_posts() ) {
    		$query->the_post();
    		echo '<li>' . get_the_title() . '</li>';
    	}
    } else {
    	// Постов не найдено
    }
    /* Возвращаем оригинальные данные поста. Сбрасываем $post. */
    wp_reset_postdata();
    
    ?>
    

    How can I applay the theme settings for this loop?

    #480072
    Tom
    Lead Developer
    Lead Developer

    Making it look the same as the GP blog would involve some custom programming. A plugin like WP Show Posts is definitely the way to go, as it would only take some CSS tweaks to make it look close.

    #480310
    Luizik

    I tried the wp show posts plugin. Could your help me please, I did not find how to show custom fields.

    #480313
    Luizik

    Actually I found your snippet how to add custom fileds. Thank you very much!

    #480629
    Tom
    Lead Developer
    Lead Developer

    Glad you found it 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.