Post Formats Help
-
Hi guys, I’ve been spending my spare time creating my own theme using post formats and have run in to a couple of problems. You can see the site here:
Problem #1
How do you display all the posts with the ‘standard’ post format?
I’ve used this link code to display all posts with the ‘images’ post format:
<?php echo get_post_format_link('images'); ?>
And it links correctly to this page:
https://peterclaridge.me/type/image
However if I try using:
<?php echo get_post_format_link('standard'); ?>
The link doesn’t go to the ‘standard’ format type link
*****
Problem #2
Still related to the post formats and the ‘standard’ format issue. In the footer of my site I’ve got a list of Recent Posts and Popular Posts. Next to each one I want to display the correct post format icon.
Initially I tried to use some If statements to show the correct post icon, and that worked for everything except the ‘standard’ post format, the code is given here:
(On a side note, I think it would be better to use a PHP Switch function instead of having all these if statements? I’m not sure how to do that though)
How can I get the article post icon to show up for ‘standard’ post format blog posts?
*****
Problem #3
How can I get the category ID of the post when the information is displayed outside the main loop?
To the right of each blog post I have created a section called ‘More From This Category’ and I want to list 3 random posts from the same category as the individual blog post.
At the moment I have simply hardcoded a random category ID so it will pull posts even if it’s from a different category to the blog post.
Basically where it says [cat=5] I want it to be [cat=*category ID of the individual blog post*]
*****
Any help you can provide would be really appreciated, I’ve spent weeks working on this theme and learning all the in’s and out’s of building a wordpress theme but these three little things are still causing me problems!
Thanks,
Peter
- The topic ‘Post Formats Help’ is closed to new replies.