I have files in my theme called single-audio.php
and single video.php
, but when I click on an audio post-format or video post-format wordpress uses the index.php
instead of my single-audio.php
or single-video.php
files. Any ideas?
Leave a Reply
You must be logged in to post a comment.
There is a huge difference between Post Formats and Post Types. I am assuming you are using post formats, which do not have a default template file for you to use.
What you can do though is use
has_post_format()
to see if the post has the format you are using, and if it does, useget_template_part()
to get a specific template file that you created to display there.For example:
If you really want to use single files for each post-format type you could try something like this: (paste to functions.php)
It’s a possible solution, but I wouldn’t recommend it, as long as you’re not 100% sure about what you’re doing resp. what is happening here.
Jared response is the recommended way of dealing with post-formats.
If I understand your question correctly, you would need to do the following:
HTH