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. User Avatar
    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. User Avatar
    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?

    • User Avatar
      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. User Avatar
    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!!

Submit a Comment

Posting Code

You may write comments in Markdown. This makes code easy to post, as you can write inline code like `<div>this</div>` or multiline blocks of code in triple backtick fences (```) with double new lines before and after.

Code of Conduct

Absolutely anyone is welcome to submit a comment here. But not all comments will be posted. Think of it like writing a letter to the editor. All submitted comments will be read, but not all published. Published comments will be on-topic, helpful, and further the discussion or debate.

Want to tell us something privately?

Feel free to use our contact form. That's a great place to let us know about typos or anything off-topic.

icon-closeicon-emailicon-linkicon-logo-staricon-menuicon-searchicon-staricon-tag