We in the midst of stripping down our WordPress theme to about as bare-bones as we can get it. We're not worried about the design we're trying to get to, we're concerned about stripping away the old and giving us the cleanest most data-only theme we can get to start with.

Comments

  1. domenico colandrea
    Permalink to comment#

    loved the 1st series..cant wait to get to the juicy stuff in this one..howd you get your tabs and stuff all cool and red in sublime??

  2. Gary A
    Permalink to comment#

    I think the reason behind using a loop for single items is that you have control over showing or not showing stuff if for some reason you get to a post that doesn’t exist (or was deleted). I’m not sure how this would be possible in WordPress, though.

    As far as I know, doesn’t the WP engine end up serving index.php if it can’t find a specific page/post?

    • Angel Paunchev
      Permalink to comment#

      That’s correct. It’s generally a good practice to have an if statement that checks if the posts exist before looping through them. If they don’t, then you’d display an appropriate message, like so:

      <?php if ( have_posts() ) : ?>
          <?php while ( have_posts() ): the_post(); ?>
              <?php the_content(); ?>
          <?php endwhile; ?>
      <?php else : ?>
          No posts found.
      <?php endif; ?>
      
  3. Rodrigo Ibarra
    Permalink to comment#

    Wow… now I wonder why oh why I never do this before starting up a new project… Rule No.32 Enjoy the little things!!

Leave a Comment

Posting Code

We highly encourage you to post problematic HTML/CSS/JavaScript over on CodePen and include the link in your post. It's much easier to see, understand, and help with when you do that.

Markdown is supported, so you can write inline code like `<div>this</div>` or multiline blocks of code in triple backtick fences like this:

```
<script>
  function example() {
    element.innerHTML = "<div>code</div>";
  }
</script>
```

We have a pretty good* newsletter.