Post Formats in Loop (loop in function w/sticky)
-
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 -> https://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 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Post Formats in Loop (loop in function w/sticky)’ is closed to new replies.