Forums

[resolved] custom post page (3 posts)

  1. mrakmo
    Member
    Posted 3 years ago #

    Hi,

    I'd like to have a custom wordpress post page with latest post displayed, but without header, sidebar and footer, the included php files. So not like the single.php file. I'd like the functionality of index.php front page without the template look on this post. Closest thing I found was the capability to do custom wordpress page with custom template but it didn't do anything with php post functions.

    Any help with this is appreciated

    Cheers,
    Mark

  2. VelvetBlues.com
    Member
    Posted 3 years ago #

    Yeh, you'll need to create a custom template for this page.

    You can create a page and set a unique template for that page which shows that special post without a header, footer, or sidebar.

    In your new template, just mimic the standard template - if you want to include page text above the post - but don't include the header, footer, or other includes... And then you might want to use get_posts()

    It'll be something like:

    <?php
     $lastpost = get_posts('numberposts=1');
     foreach($lastpost as $post) :
        setup_postdata($post);
     ?>
     <h2><?php the_title(); ?></h2>
     <?php the_content(); ?>
     <?php endforeach; ?>
  3. mrakmo
    Member
    Posted 3 years ago #

    that works, thanks VelvetBlues.com

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.