S
S
SMK DN2016-09-07 20:37:00
CMS
SMK DN, 2016-09-07 20:37:00

How to display posts on a static WordPress home page?

There is a site on WP, the main page is static.
Pages for displaying records - no.
You need to display posts (of a certain category or by id, whatever, as long as it works) on the main page in such blocks (see photo)
f7ef571705034512bc5ab72f3a653593.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel, 2016-09-07
@Palych_tw

We read carefully here wp-kama.ru/function/wp_query
Something like this

<main>
  <h1>Главная</h1>
   <?php $args = array(
    .................
    );
   $query = new WP_Query($args);
       while ( $query->have_posts() ) {
    $query->the_post(); ?>
         <div>
                      <?php the_post_thumbnail();?>
                      <?php the_title(); ?>
               </div>
  <?php } ?>
</main>

D
Denis Yanchevsky, 2016-09-08
@deniscopro

If writing code is tight, then you can try one of the plugins. For example, the Shortcodes Ultimate plugin has a Posts shortcode , maybe it will work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question