Paid Forum Posts

Get excellent content for your forum or earn money as a paid forum poster.

Free Forum Admin Book

Learn how to start your community and make it a success. FREE download.
  1. Admin Forum - for blog and forum owners

    Do you run a blog? A forum? Read useful forum and blogging articles, find out the secret of creating a TOP community. Registration is FREE!
  2. Advertising, domain names and more ..

    Each of your posts/threads earns you points. Use these to redeem advertising plans on this forum or get REAL domain names and cpanel hosting accounts to use for your sites.

  3. Do you have a brand new forum?

    If you do, then you need members and posts to kick start it. Join our Forum Starters program and get members and posts for your brand new forums

  4. Make Money Online

    Are you a good forum / blog theme designer? An experienced content provider? Post the jobs you can provide, set your price and have clients hire and pay you. NO commission free job marketplace.

Wordpress: how to list latest posts with different formatting

Discussion in 'Blog Advice and Articles' started by dojo, Feb 14, 2012.

  1. dojo Administrator

    Message Count:
    2,961
    Money:
    7,172
    If you'd like to create a theme that's 'nifty' and interesting, then the way your listing your articles should be worked on too. What if you could have the latest 3 posts displayed in a manner and the other 4 to have a separate formatting? Such as on www.dojoblog.net: you can see there is a big 'latest post', and then 4 other posts with a smaller thumbnail and no excerpt.

    Here is the 'core' code for this. Please don't forget you'll need to style these, of course.

    FIRST POST(S)

    PHP:

    <?php query_posts('showposts=1'); ?>
    <?php 
    if (have_posts()) : while (have_posts()) : the_post(); ?>
    <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
    <?php the_excerpt('Read more ยป'); ?>
    <?php 
    endwhile; endif; ?>
    If you'd want to show more posts than 1 as I have you can change showpost='your chosen number'. Feel free to add a nice div for these posts, change the elements (maybe you add a thumbnail, or don't display the excerpt). You're free to 'create'.

    THE REST OF THE LATEST POSTS (EXCLUDING THE ONES YOU ALREADY HAVE)

    It's no fun having 2-3 posts show two times on your design. So with this code our latest posts (that come after the ones we already styled) can be placed like this:

    PHP:
    <?php query_posts('showposts=4&offset=1'); ?>
    <ul>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
    <?php endwhile; endif; ?>
    </ul>
    In my example I have chosen to just list the titles, you can add excerpts, thumbails of a different size, whatever you feel like, and change the showposts and the offset with the according numbers.

    Enjoy ;)
    CristinaTM likes this.
  2. CristinaTM Just joined

    Message Count:
    4
    Money:
    8
    This is going right into my web dev's inbox. Tnx for the tip. I've noticed that I have to change the way my last posts are displayed, because readers tend to stop clicking on the links after they get used to see them there.
  3. dojo Administrator

    Message Count:
    2,961
    Money:
    7,172
    It's a cool trick and can actually help, especially if you're not posting more articles/day. If you do so, just change the number in the offset setting and you can show more posts with the same formatting.
  4. infinity79 Just joined

    Message Count:
    1
    Money:
    2
    What is query_posts function exactly doing?
  5. dojo Administrator

    Message Count:
    2,961
    Money:
    7,172
    There you have their 'official' explanation in the Wordpress Codex. I'm more of a 'script monkey', so can't explain it well.

    PS: welcome to TC. Nice having you here ;)
  6. stone Just joined

    Message Count:
    2
    Money:
    4
    I've experimented with "read more" links, and people didn't seem to like clicking to see the rest of the entry.
    I've since discovered when visiting other people's blogs, that without a picture or other strong inducement, I didn't want to click their 'read more' link either.
    While those excerpts look snazzy, if people aren't visiting the posts, the format isn't working.
    I still may experiment with this coding at some nebulous future time... Cause... it sure looks nifty.
  7. Alfred Level 4

    Message Count:
    415
    Money:
    902
    I updated my blog so that it doesn't show an excerpt but the whole post, media and all.
    Just take the php code from the page template (I forgot what it was) and stick it in the blog template. :)
  8. Geoffrey Senior Member Lv. 1

    Message Count:
    2,376
    Money:
    4,828
    Alright, my noob is showing.

    Where do these codes go? What is this styling that you say needs to be done?
  9. dojo Administrator

    Message Count:
    2,961
    Money:
    7,172
    Wherever you want the posts to appear like this: www.dojoblog.net - here is an example of various listings (latest posts in the left, the 'money' area, the 'forum/blog' areas. The codes are in INDEX.PHP (the theme files, not wordpress's index). All these draw posts from the specific categories, even the travel listing is the same, it's just that I used only the thumbnails and titles and not excerpt.
  10. Alfred Level 4

    Message Count:
    415
    Money:
    902
    You use WordPress right?
    Under "Themes" is "Editor"
    The "index.php" file is the one you have to edit :)
    I recommend copying the code from the blog page template.

Share This Page