WordPress.org

Ready to get started?Download WordPress

Forums

get_page, layout is gone.. (3 posts)

  1. vanhansen
    Member
    Posted 2 years ago #

    So, here's the original page:
    click me!

    and this is the frontpage:
    click me, too!

    So, do you see the difference? Paragraphs and spaces are gone.. Does it mean I have to use php code manually, or is there some other way? Here's the code getting the content.

    <?php
    				$page_id = 12;
    				$page_data = get_page( $page_id );
    				$content = $page_data->post_content;
    					echo $page_data->post_content;
    			?>

    And while I'm at it.. I would like to get the title of the page as well, would make it a bit easier in the future :)

    Thanks in advance, love you all <3

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    or possibly use the 'the_content' filter;

    i.e. try:

    echo apply_filters('the_content',$page_data->post_content);

    the page title would be:

    $page_data->post_title

    and just in case, the permalink:

    get_permalink($page_data->ID)

Topic Closed

This topic has been closed to new replies.

About this Topic