WP Pro - Web Design, Development & Pro WordPress Hosting for Serious Bloggers


Anatomy of a Magazine Style Premium WordPress Theme – Part 1 “The Loop”


Welcome back! Have you subscribed to my RSS feed? If not, please consider doing so. Thanks for again for visiting!

Now for some styling

One more step and we are done. In order to style the various options, we will have to create and style the following divs and classes:

In the first example (featured and non-featured), define:

  • .featurepost (to style featured posts)
  • .post (to style regular posts)

The second example has only one distinctions between the featured and the non-featured post, that is the length of the posts (full and excerpt), so the styling will remain common for both.

The third example (asides), we need to define the following:

  • .asides_entry
  • .asides_entry ul
  • .asides_entry ul li

What I did here was adopt a stylesheet by David Herreman with some personalization to style our demo theme; you can see it in action here or download the original CSS from David’s site if interested.

Next up, we will build cool tabbed interfaces for your sidebar using DOMtab, tabber and other free JavaScripts.

So there you have it. Happy hacking and share these ideas with all. Enjoy!

References: Codex, David Herreman, MandarinMusing, Solostream, wpSnap and a whole bunch of premium theme demo’s

23 Responses to “Anatomy of a Magazine Style Premium WordPress Theme – Part 1 “The Loop””

  1. Thanks a lot for that very useful article. It’s one of the more interresting posts I have read on Wordpress themes. I’m very impatient to discover the two next ones. “Bravo” as we say in french…

  2. @ Pierre K

    Merci, je posterai les articles autre bientôt! Let me know if my French is legible.

  3. Bravo, love the concept of making a blog more like a magazine. I’ll be sending this off to the tech guy in my life.

  4. @ sveinson

    There is more to come, the next part is about tabbed interfaces for widget presentation.

  5. Is it possible to have a feature article for each of my categories. For example, if you click any of the categories in the News theme at http://quommunication.com/demo/news/ it has a feature article dynamically listed.

  6. @ Gio

    Yes, it is possible to replicate that. All you need to do is copy and paste all the code from index.php onto the category.php file (create one if your theme does not have one).

    Replace just one line of code, look for:

    < ?php $my_query = newWP_Query(’category_name=Featured&showposts=1′); while ($my_query->have_posts()) :$my_query->the_post(); $do_not_duplicate = $post->ID; ?>

    make that

    < ?php $my_query = newWP_Query(’showposts=1′); while ($my_query->have_posts()) :$my_query->the_post(); $do_not_duplicate = $post->ID; ?>

    Essentially you deleted

    category_name=Featured&

    Which will mean the featured post will now have one post from the cateogry that you clicked (since WordPress automatically displays only the chosen category in a category page). I am pretty sure you can do that with just the archives.php page if you don’t feel like or unable to create a new file.

  7. I have been fiddling with my site’s redesign, and I’m really confused about how to code for the Wordpress Loop.

    I’m trying to set it up this way:

    1) Latest post, 2) Featured, 3) Asides, and 3) Other latest posts, other than post #1

    Basically, “Featured” and “Asides” are interrupting the first post from the other recent posts.

    Please let me know how to do this.

    http://www.ResponsibleChina.com

  8. @ Erica

    Since you are pulling only one Latest and Featured posts each, you can use conditional queries to pull only one of each from categories designated for each of the post type. The asides and the other latest posts can both fall within a regular loop. The strategy is to use the above technique that creates featured posts in a magazine style theme and use it instead to pull one latest and one featured. You can do this by setting the number of posts in the 2nd loop also to 1 just like you will for the 1st.

    Next, you start a new conditional multiple loop that pulls 10 posts, then within that, you set the asides styling and have it display in the 1st loop. Hope I am making sense, if you still have trouble, email me via contact page.

  9. Hi

    I have been looking around for good examples of multiple loops use in WP.

    I am desperately trying to make something similar work for my blog. My desired setup would have:

    On front page, the latest post from categoryX, followed by the latest post from categoryY then two lists outside the loop ( I think ) with the top 5 rated articles in one and the 5 most viewed posts in the other. Both of these lists would be generated by plugins (and repetition of posts not an issue on the frontpage which would not show posts in the loop after the two featured ones)

    However in my archives page I would need to show all posts grouped by month.

    Any help/tip/idea to modify the code above for my needs would be immensely appreciated.

    C.

    p.s I realise my request is similar to previous comment but still need help.

  10. @ Chico

    One loop can display posts from X and then Y, use this method from Codex.

    To display archives on a monthly basis try using a plugin such as this.


Trackbacks

  1. PHP Coding School » Blog Archive » php code [2008-01-11 23:41:27]
  2. xoxoANP!
  3. Anatomy of a Magazine Style Premium WordPress Theme - Part 2: DOMTab, Tabber, more // Headsetoptions.org
  4. A Vertitable Tsunami of Goodness « Feet up, eyes closed, head back
  5. Anatomy of a Magazine Style Premium WordPress Theme - Part 3.1 “Navigation – Second Level Menu” // Headsetoptions.org
  6. baccarat free
  7. multiplayer svensk internet casino på svenska
  8. Wordpress Themes: 20+ Tutorials, Clubs, Themes, and Resources | Outlaw Design Blog - A Graphic Design Blog
  9. Comment on Anatomy of a Magazine Style Premium WordPress Theme …
  10. When To Use Magazine-Style Themes For Blogs? | How-To | Smashing Magazine
  11. Anatomy of a Magazine Style Premium WordPress Theme – Part 2: DOMTab, Tabber, more » WP Pro - Web Design, Development & Pro WordPress Hosting for Serious Bloggers
  12. Anatomy of a Magazine Style Premium WordPress Theme – Part 3.1 “Navigation – Second Level Menu” » WP Pro
  13. Doug Hogan » daily life

Leave a Response

Some Useful Info

Use SimpleCode while including codes.

The links from all comments have the no-follow tag to prevent spammers from gaming their way up into SERP. So please keep the comments clean, try not to use keywords as "Names" or post unnecessary links in the comments. Thank you for cooperating.



Copyright © WP Pro - CSS | XHTML | Login | Return to Top ↑