Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

HaloPinay on "Post Formats in Loop (loop in function w/sticky)"

$
0
0

In my index.php, I have

<?php
            if(have_posts()) :
                while(have_posts()) : the_post();
                    echo cool_post_article_normal_block();
                endwhile;
            endif;
?>

So in funcitons cool_post_article_normal_block() says...

link -> http://pastebin.com/WDDJC6ks

What I understand is that I'm supposed to modify between <article></article>but what I don't know how to do is get the post format conditionally; especially since there is already a sticky conditional-- and I don't know PHP well :(

I'm very new to PHP so I'm unsure how to do this. I have several post formats activated: quote, video, gallery, audio, image.

I'd like the loop to go something like:

if sticky
if quote
 show title only
if video, audio, gallery
 show title
 show excerpt
if image
 show title
 show featured image
else
if quote
 show title only
if video, audio, gallery
 show title
 show excerpt
if image
 show title
 show featured image

Viewing all articles
Browse latest Browse all 8245

Trending Articles