WP 3.1 Post Format Conditional Not Working as Expected
-
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:
https://wordpress.pastebin.com/FVU8Wnk1So 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 cdn.rvoodoo.com
- The topic ‘WP 3.1 Post Format Conditional Not Working as Expected’ is closed to new replies.