WordPress.org

Ready to get started?Download WordPress

Forums

Single-post frontpage (11 posts)

  1. nohea
    Member
    Posted 8 years ago #

    Hello,

    I'm setting up a blog for a project here on a testpage: http://urbangriffin.com/unjour/ and would like the blog homepage to display only one post, the most recent post, with a link below that entry that will lead to the monthly archive page of the current month. How should I do that ?

    Is it possible also to use a different sidebar for both the homepage and the archive pages ?

    Thank you! Any help will be greatly appreciated.

    Lysiane.

  2. moshu
    Member
    Posted 8 years ago #

    I think all that can be done - not without some work, coding, customizing.

  3. nohea
    Member
    Posted 8 years ago #

    Thank you. I'm up to the customizing job if anyone would kindly walk me through the main steps or hand me some tips to start me off... ? This is my first thorough attempt at setting up a WP blog, and I'd be very grateful for any help.

  4. nohea
    Member
    Posted 8 years ago #

    Alright, I've got the differentiated sidebars for index vs. archives part down. I cannot find a thread on posting a single entry on the frontpage with just "single post" yet, however...

  5. charle97
    Member
    Posted 8 years ago #

  6. nohea
    Member
    Posted 8 years ago #

    Fantastic, thanks! I can't believe I've done most of the blog in one evening.

    I would have one more touch to bring, which would be to have the 'Read more' link function only when a recent post is displayed on the frontpage. When visiting the Archives or Category pages, I would like the posts to appear in their entirety without having to follow the 'More' link to the single entry page.

    Would somebody know something about this and like to share ? :)

  7. charle97
    Member
    Posted 8 years ago #

    check the is_home conditional

  8. moshu
    Member
    Posted 8 years ago #

    Even simpler: use different template files for the different views - so you cna style and tweak them as you wish. Meaning for the frontpage you use the index.php (alternatively, if needed: home.php) and for the archive view - archive.php. (The default theme will give you a good idea to start.)
    This approach is even more recommended if you want to have different sidebars for the home page and the archives view.
    (Though even that can be achieved by Conditional Tags.) And if you go for a separate archive template, just include the second sidebar with a php include:
    <?php include (TEMPLATEPATH . '/sidebar2.php'); ?>
    Use it as it is, literally, change only your file name!

  9. nohea
    Member
    Posted 8 years ago #

    Thank you, Moshu, especially for indicating how to add a second sidebar. I had figured how to do seperate archives already but for the index.php, had in fact removed the <? get_sidebar(); ?> and had hardcoded there its own sidebar in its place. Charle97's idea was interesting and I will keep it in the drawer for other uses.

    Concerning the 'More...' feature:

    The rest of the post continues, but when viewed on the non-single/non-permalink web page such as archives, categories, front page, and searches, the post is shown as an excerpt to the more point.

    I would like a post to be displayed as an excerpt only on the frontpage but to be uncut when viewed in an archive, category or search page. I have used the content () and <!--more--> technique so far. If I try to tweak the archive.php template, I do not seem to be able to achieve this.

    Any ideas ? :)

  10. nohea
    Member
    Posted 8 years ago #

    I found this great plugin: http://guff.szub.net/2005/02/26/the-excerpt-reloaded/. I'm amazed. WordPress is so cool. I wish I hadn't been afraid by all the PHP snippets when I first began building my site last winter. I want to move my own personal stuff here now!

    I would have one last question, now...

    Well, probably two in fact:

    I have limited the archive links on my frontpage to display only a link to the most recent monthly archive. How to customize that to 'More news...' or 'News' instead of a date format ?

    WP will be installed in a root directory, like so: http://unjour.ch, and I would like to have the archives sit in a subdirectory in it called '/news/' if possible. Is that feasable ?

    Thanks all! You've been very kind already.

  11. moshu
    Member
    Posted 8 years ago #

    1. Not without altering core files.
    2. Not possible. Practically there are no real, physical directories in WP's structure - just "virtual" directories created by the permalink settings.

Topic Closed

This topic has been closed to new replies.

About this Topic