Support » Alpha/Beta/RC » WP 3.1 Post Format Conditional Not Working as Expected

  • Resolved Rev. Voodoo


    I know 3.1 is still beta, but it’ll be live soon enough. And I believe this may be related to my coding/logic rather than WP. So here is my issue. I have a loop.php set up. It has all my loop stuff in it with a bunch of if, else, etc. Throughout my theme I use get_template_part with a variety of template options based on loop loop/index, loop/archive, loop/shop, etc.

    I want to keep the loop.php functioning, it’s good for child theme-ability….folks can override the loop as needed per template.

    Now I’m trying to institute post formats. So what I wanted to do was conditionalize it to my loop.php.

    Basically set the unset (get_post_format=false) posts to be ‘standard’ and then off load from there. If post format= standard, do teh normal loop, otherwise head out for a format template

    So, index.php calls:

    <?php get_template_part( 'loop', 'index' ); ?>

    (now I only have a loop.php, so it’s used for everything)

    And loop.php now looks like:

    So what I thought I was doing there, is at line 13, setting format=false posts to standard

    at line 19 saying if the post is ‘standard’ do all the normal loop crap

    and at line 150 if the loop is anything else, run off to the appropriate format template

    What happens though, is that only the post with a format applied to it is displayed. I get one post (quote) with the formatting from the appropriate format template, none of the normal loop stuff

    So, where’s the flaw in my logic? It’s the tail end of Friday, and I just spent all week restoring my site off of old post revisions and google cache after a serious sql issue….. so I’m frazzled and maybe not following this through properly.

    Thanks once again all!
    Also, the site is public for now on my test install at

Viewing 2 replies - 1 through 2 (of 2 total)
  • Alright, I figured it all out to my satisfaction. Too much to explain here for sure. I’ll make a post on my site about it (and report a link back)… it was a combination of lack of understanding of php code, and confusion wanting to keep my loop.php functions intact, and implementing formats, while keeping the widest amount of options open for child themeing….. I just had to get it straight in my noodle

    OK, here’s what I did to maximize child theme functionality while including post formats

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP 3.1 Post Format Conditional Not Working as Expected’ is closed to new replies.