Last active
August 29, 2015 14:26
-
-
Save kostiantyn-petlia/1f975886d8a02351de9d to your computer and use it in GitHub Desktop.
WP: get someone post (p=123)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query_posts('p=3547'); // - записи присвоен идентификатор, равный 3547. | |
if (have_posts()) : // - если есть вообще указанная запись. | |
while (have_posts()) : the_post(); // - начинаем традиционный цикл WordPress. | |
print '<div id="post-'; the_ID(); // - выводим ID записи и её класс. | |
print '"'; post_class(); print '>'; | |
print '<h4>'. get_the_title(). '</h4>'; // - выводим заголовок. | |
print get_the_content(); // - выводим содержимое. | |
print '</div>'; | |
endwhile; | |
endif; | |
// or | |
query_posts('name="Здесь должен быть прописан титл искомого поста блога"'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment