• Hi

    I purchased a template online and I want to make a slight modification to it. As its currently setup it shows the last 5 posts on the front page. Over the posts I want to add a particular page but I cant do that via the templates admin area. I have been googling how to do this but I cant find anything. I know I need to add a PHP snippet with the page ID etc but I cant figure out how to do this.

    Note: I know how to add a Static Front Page but doing this prevents the last f blog posts from showing.

    Thanks in advance!

Viewing 1 replies (of 1 total)
  • Thread Starter WillOfTheWeb

    (@willoftheweb)

    Found the info I needed. FYI:

    <?php
    $page_id = 123; // 123 should be replaced with a specific Page's id from your site, which you can find by mousing over the link to edit that Page on the Manage Pages admin page. The id will be embedded in the query string of the URL, e.g. page.php?action=edit&post=123.
    
    $page_data = get_page( $page_id ); // You must pass in a variable to the get_page function. If you pass in a value (e.g. get_page ( 123 ); ), WordPress will generate an error. By default, this will return an object.
    
    echo '<h3>'. $page_data->post_title .'</h3>';// echo the title
    
    echo apply_filters('the_content', $page_data->post_content); // echo the content and retain WordPress filters such as paragraph tags. Origin from: http://wordpress.org/support/topic/get_pagepost-and-no-paragraphs-problem
    ?>

Viewing 1 replies (of 1 total)
  • The topic ‘Adding a particular page to Front Page along with posts’ is closed to new replies.