New Topic

Make Front Page the most recent post

Home › Forum › Customization › Make Front Page the most recent post

This topic contains 11 replies, has 2 voices, and was last updated by  StartupWP 3 years, 1 month ago.

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1034

    inmyimage
    Member

    I am using StartupWP Pro, and have tried everything from using categories to using the “Post Content Shortcodes” plugin, combined with various selections in the “Reading Settings” “Front page display” options… but I can’t figure out how to configure the theme to do what I want…

    What I want to do is have the “front page” load the most recent post like: http://www.inmyimage.com/blog/fans-fans-and-more-lights/

    Just to be clear, I don’t want the content of the post on the front page, I want the front page to actually be the post, not just the content of the post.

    The reason that I want to do this is so that when people comment on what looks to them like the post, the comments need to actually be in response to the post and not the page which is what seems to happen if you simply pull the content into a page. This is required so that comments on a post are maintained during it’s lifecycle.

    If I use the default configuration for the “Home” page, then the most recent post is displayed by default, but there doesn’t appear to be anyway to turn on commenting for that post or page as the settings for the page named “Home” seem to be ignored as can be seen here: http://www.inmyimage.com/blog/ which currently has “Allow comments” and “Allow trackbacks and pingbacks on the page” enabled.

    Using the plug-in that you was provided in response to my migration questions, called “Post Content Shortcodes”, comments appear to be active as can be seen here , but if you compare the comment section on post-content page to the comments on the actual post itself as seen at you will quickly notice that the test comment I posted do not appear on the post itself.

    I really like the theme, but really want this functionality to work, even if it means adding a .php file and using some WP-query commands to get what I want.

    Thanks!


    #1038

    StartupWP
    Support

    This will require a custom page template. Please note that this is a special request and we’re not aware of any theme that has such capability by default, so you know, it’s not somehow a limitation of StartupPro, no theme has such capability out-of-the-box.

    1. If you don’t already have a child theme setup, set one up:

    https://startupwp.com/topic/child-theming/

    2. Add a new custom page template to your child theme named home-post.php with the contents:

    <?php /* Template Name: Home Post */ ?>
    <?php get_header(); ?>
    <div id="content">
    <?php query_posts( 'posts_per_page=1' ); ?>
    <?php while ( have_posts() ) : the_post() ?>
    <?php get_template_part('entry'); ?>
    <?php comments_template(); ?>
    <?php endwhile; ?>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    3. In your WP admin, create a new page named “Home Post” and assign it the custom template.

    4. Under Settings > Reading set “Home Post” as the static frontpage.

    This is untested, but should work.

    #1039

    inmyimage
    Member

    Thanks, I agree that there does not appear to be a theme that has this functionality today but after looking at probably a couple hundred descriptions and finalizing on a dozen to beta test, I decided to go with StartupWP because it did most of what I wanted easily, and you have a great response to questions and issues on this support forum and are willing to help with some extra code and/or advice to try to get a customer’s customizations implemented.

    That being said I figured I’d have the best shot at this implementation going with StartupWP Pro.

    Now, I did implement the child theme (which was a lot easier than I expected) and created the php file with a copy and past of the code you provided and while it does display the latest post, it doesn’t show the comments section.

    I tried it with the static page set as both a “Front page” and a “Posts page”, but with no difference. I also tried with comments on and off on the page itself, in addition to setting the Reading Option for “Blog pages show at most” at the default of 10 and 1.

    Any additional thoughts are appreciated, if we can get this to work, it would be a nice differentiating feature to advertise.

    Bill


    #1041

    StartupWP
    Support

    Thank you for choosing StartupWP. :)

    Hopefully, it’s as simple as updating the template to:

    <?php /* Template Name: Home Post */ ?>
    <?php get_header(); ?>
    <div id="content">
    <?php query_posts( 'posts_per_page=1' ); ?>
    <?php while ( have_posts() ) : the_post() ?>
    <?php get_template_part('entry'); ?>
    <?php comments_template('', true); ?>
    <?php endwhile; ?>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    #1043

    inmyimage
    Member

    Bummer, no improvement.

    Just to be sure, I created another template and page with a fresh php file just to make sure I wasn’t seeing any sort of caching issue on the server or my browser.

    Bill


    #1044

    StartupWP
    Support

    Alright, let us do some more testing an get back to you.

    Thanks

    #1048

    inmyimage
    Member

    Another option is if you know how to form a link that would pull the latest post directly.
    This would allow me to set my domain forwarding URL to the “home” URL that pulls the latest post, and then I can add a menu item that does the same thing.
    Seem like a good alternative while we try to figure this out, assuming we can?
    Thanks for all your efforts will definitely be leaving a 5 star review of the theme, just hoping I can highlight a new feature for you in the comments ;)
    Bill


    #1049

    inmyimage
    Member

    Hey, we are closer than I thought!!!

    After trying to finalize the “beta” layout so that I can start getting actively posting while continuing this effort on a new deployment of WordPress, I discovered that the template file that you gave me is working!!!

    It is just that the comment link is simply at the end of the tag cloud and blends in completely to it.

    See Screen Shot: https://dl.dropboxusercontent.com/u/18993675/StartupWP%20Pro%20Support/Home%20Post%20Comment%20Link.JPG

    You can see the behavior directly at

    So, it would seem that what we really need to focus on is:

    1) Separate the comment link from the end of the cloud and make it standout.

    2) Show existing comments

    3) I’ll start a new thread on this in general later, but in case it needs to be different for this template, hide the post specific tag cloud, as well as the “Posted in” category list, completely.

    Thanks again for all the effort,

    Bill


    #1050

    inmyimage
    Member

    Don’t know why the link to the page did not appear, but you can see the current behavior first hand at:



    #1051

    inmyimage
    Member

    Okay, apparently the link button either isn’t working or something is filtering out the link: http://www.inmyimage.com


    #1052

    inmyimage
    Member

    Forgot to leave the screen shot of the comment link before having an approved comment: https://dl.dropboxusercontent.com/u/18993675/StartupWP%20Pro%20Support/Home%20Post%20Comment%20Link%202.JPG

    Note that I deleted the test comment that I left and that page assigned to the home-post.php template has commenting turned off at the page level.

    Thanks again,

    Bill


    #1056

    StartupWP
    Support

    Let’s go back to:

    <?php /* Template Name: Home Post */ ?>
    <?php get_header(); ?>
    <div id="content">
    <?php query_posts( 'posts_per_page=1' ); ?>
    <?php while ( have_posts() ) : the_post() ?>
    <?php get_template_part('entry'); ?>
    <?php comments_template(); ?>
    <?php endwhile; ?>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Now for that page under Pages in your WP admin, when editing, go top-right and click on “Screen Options” to make sure that the “Discussion” box is checked and then, that “Allow Comments” is checked below. If that’s a no go, we’ve unfortunately run out of ideas.

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.