J
J
John2016-03-30 12:06:04
WordPress
John, 2016-03-30 12:06:04

How to get a record by ID?

Recording:
1636a4cd374c4db88a86382a06112813.png
I output it like this:

<?php if ( have_posts() ) : query_posts('post-1');
                while (have_posts()) : the_post(); ?>
       
                <p><?php the_content(); ?></p>
     
                <? endwhile; endif; wp_reset_query(); ?>

But in the end it displays "Parse error: syntax error, unexpected..." What is wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2016-03-30
@dimasmagadan

you took not the id, but the slug of the entry,
try this
https://wordpress.org/support/topic/get-single-pos...
or this
stackoverflow.com/questions/14979837/wordpress-que...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question