• Hi,
    I don’t know PHP very well, I’m trying to insert the content of an article in a specific place.

    The aritcle ID is 2073. This is the code I wrote:

    <div class=”detailsnews”>
    <?php the_post(2073); ?>
    <div id=”post-<?php the_ID(2073); ?>” class=”post_detailed”>
    <div class=”entry”>
    <?php the_content(); ?>
    </div>
    </div>
    </div>

    …but instead of appearing the 2073 article, it appears the last article writen (by date).

    Can you help me to fix it?
    Thanks a lot

Viewing 2 replies - 1 through 2 (of 2 total)
  • If you’re not within The Loop, you can’t call the_post() (or the_ID(), for that matter). Instead, you’ll probably want to call get_post():

    <?php $post_2073 = get_post( '2073' ); ?>
    <h1><?php echo $post_2073->post_title; ?></h1>
    <p><?php echo $post_2073->post_content; ?></p>
    Thread Starter fanciullino

    (@fanciullino)

    Exactly! Thanks a lot!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘The article content where i need it. Help!’ is closed to new replies.