get_page, layout is gone.. (3 posts)

  1. vanhansen
    Posted 4 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.

    				$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. Michael
    Forum Moderator
    Posted 4 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:


    and just in case, the permalink:


Topic Closed

This topic has been closed to new replies.

About this Topic