WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] get content of specific page (7 posts)

  1. assaf_scialom
    Member
    Posted 4 years ago #

    Hello,

    I am trying to create 2 sections in my page.
    Section 1 will take the content from the default page (for example: about us)
    Section 2 will take the content from another page (for example: FAQ's)

    of course with the first part I don't have a problem, but how can I insert the second section into my template?

    many thanks!

  2. Robert S
    Member
    Posted 4 years ago #

    @assaf_scialom,

    Just what the doctor ordered:

    Improved Include Page plugin.

    If you want the php code to do the same job let me know.

    R

  3. assaf_scialom
    Member
    Posted 4 years ago #

    Thanks,

    I would like to get the php code for that.

  4. Robert S
    Member
    Posted 4 years ago #

    @assaf_scialom,

    I'm sure there's probably other ways to do this but pop this in the relevant template. Note that "5369" is the ID of the page I wish to include:

    <?php
    $my_id = 5369;
    $post_id_5369 = get_post($my_id);
    $content = $post_id_5369->post_content;
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]>', $content);
    echo $content;
    ?>

    R

  5. assaf_scialom
    Member
    Posted 4 years ago #

    thanks - that works!

  6. Robert S
    Member
    Posted 4 years ago #

    Onya @assaf_scialom !

    R

  7. poliquinp
    Member
    Posted 3 years ago #

    This code actually work very well! I just tried it on my blog and this got my things done!

    Thx @rschilt

Topic Closed

This topic has been closed to new replies.

About this Topic