• Good afternoon everyone.
    The need is relatively simple but for some reason I can not make it work and not found anywhere solution. I need a PHP code or function of WordPress to show the contents of a post by id. This code will be inserted directly within a div html template of a wp . Extamente and only that. Already thank you to anyone who can help . That this breaking when I add several posts to the project:
    <?php
    $post_id = 70;
    $queried_post = get_post($post_id);
    $content = $queried_post->post_content;
    $content = apply_filters(‘the_content’, $content);
    $content = str_replace(‘]]>’, ‘]]>’, $content);
    echo $content;
    ?>

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Content post by id in div html’ is closed to new replies.