WordPress.org

Ready to get started?Download WordPress

Forums

Newspaper site (7 posts)

  1. Jblundell
    Member
    Posted 9 years ago #

    I'm considering using WordPress to build/publish an online version of a weekly newspaper. I like the ease of publishing, the categories and such, but I don't like the way my newest post always publishes at the top. I'm thinking... "Is there a way to build a page that will put the top ranking story on top?"
    I.E. http://www.dallasnews.com always has their news ranked in order of importance, not necessarily the newest news up top.
    Any thoughts or suggestions. I've been playing around with WordPress and have a few other things I wanted done completed, but the entries aren't quite laid out the way I want them yet.

  2. Jblundell
    Member
    Posted 9 years ago #


  3. fishcakes
    Member
    Posted 9 years ago #

    Hmm, well I don't know if this helps, but I mada a theme called "Zine", the main feature of which is a central "featured articles" column, which displays only articles you place in a "featured" category, while the rest of the blog flows around it. Have a look, if you're interested.

    Also helpful if you're looking to do this sort of thing with WP is the codex query_posts page, which give loads of info on how to manpulate the Loop in weird and wonderful ways :)

  4. Jblundell
    Member
    Posted 9 years ago #

    Thanks for the theme suggestion. I'd like that if it was two columns or three columns with a place for advertising on one of them. I'll try and play around with it.
    Any other suggestions?

  5. fishcakes
    Member
    Posted 9 years ago #

    Yes, a similar idea is the "News Time" theme - there's an example here or the theme's official page is here.

  6. Jblundell
    Member
    Posted 9 years ago #

    Well, I've worked and worked on code. Its 4 a.m. And my eyes are starting to glaze over. It could be the code, or the 4 beers. Either way. I've got the layout about how I want it. But now I'm having some trouble getting the headlines to display from the appropriate category.
    I'm sure there's only one thing I'm missing. I used part of the code from your theme and then parts from others.
    I thought it might have just been goofy because I didn't have enough posts, but that doesn't appear to be it.

    Here's some of the code I think I'm having issues with.
    <!--sports. for some reason this is not grabbing the right stories.-->
    <div class="sports"><h5>Sports</h5>

    <?php
    $posts = get_posts('cat=3&numberposts=5');
    foreach ($posts as $post) :
    ?>
    <div class="sports">"><?php the_title() ?></div>
    <?php
    endforeach; ?>

    </div>

    <!--end of sports-->

    Thanks

  7. Jon Bourne
    Member
    Posted 7 years ago #

    I designed the Web site for the Fairbanks Daily News-Miner using WordPress. I ran into the same problem at the beginning, but the fix was pretty easy.

    I created a PHP script that reads a directory of XML files and loads the filenames into an array. Then, I check for certain cases to sort the array.

    You can set up file naming conventions, as I have done, to allow for certain stories to be given precedence over others. For instance, our top four stories are slugged (labeled) TONE, TTWO, TTHREE, and TFOUR. These slugs are then converted to the filenames of the files that are exported from our internal news management system.

    Then, I loop over the array of filenames and process each file individually and insert it into the WP database using the $wpdb class, sleep()ing for one second between each post so that the reverse-chronological default sorting of WordPress will take effect correctly.

    Hope this helps,

    [sig moderated]

Topic Closed

This topic has been closed to new replies.

About this Topic