• Resolved basilv

    (@basilv)


    I’d like to have only a single post displayed on the main page, with a link to the previous post just like when viewing a single page.

    Unfortunately, taking the code from single.php and putting it into home.php doesn’t seem to work. It appears as though some of the tags (previous_post_link, comments_template) only work when in single=true mode. Is there a way of changing the main page to be in single mode? Would this be a plugin instead of a theme?

    Any help or pointers would be much appreciated. Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Any reason you can’t use the option in Options -> Reading?

    I don’t know off hand of any function that would accomplish this, but if you’re doing it in a theme, you could write some simple SQL to grab the most recent post.

    there is a plugin called “Custom Posts Per Page” from
    https://boren.nu/

    Thread Starter basilv

    (@basilv)

    The option in Options | Reading does work, but applies to all pages displaying multiple posts – i.e. the category & archive by month pages as well. I do want to display multiple posts on those other pages, just not on the main page.

    I’ll have a look at the plugin – it sounds pretty close to what I want.

    Thanks for the quick response.

    Thread Starter basilv

    (@basilv)

    I didn’t find the plugin on the boren.nu site, but did find it via Google on the support forums here (funny I didn’t find it before). Custom Post per Page Topic I’ll try it out and see how it works.

    i wanted to do the same thing of having just 1 post on the index and then the rest of the pages go by the Options -> Reading setting which i have set to 5

    this did the trick perfect ??

    Thread Starter basilv

    (@basilv)

    I found a better plugin that is more flexible (can change the # in the admin | options) menu. It is called Custom Query String

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to get single post on main page’ is closed to new replies.