0

I am displaying list of blogs with pagination on /blog url. The home page is a static page. Now, I want to redesign the /blog page to display thumbnail ( the featured image) with each blog excerpt. I modified content.php, and it works.

But, I am using a theme which uses content.php, content-audio.php, content-gallery.php, content-image.php, content-video.php, and so the display is different when the blog has an audio. How do I make a change so that all blog excerpts on /blog use only content.php? Are these files used for some other purpose too?

  • Seems you need to know more about the WordPress template hierarchy. Check the Codex, it will give you a good insight. – Maruti Mohanty Apr 24 '14 at 7:21
  • @MarutiMohanty You are right. Looking at the hierarchy gave me the clue! – sutara Apr 24 '14 at 7:45
1

Otherwise as suggested, this has nothing to do with template hierarchy. These templates that you are mentioning is purely for use with post formats. I qoute from the codex

Post Formats is a theme feature introduced with Version 3.1. A Post Format is a piece of meta information that can be used by a theme to customize its presentation of a post.

When a post is created/written, the author has option of available post formats in the post format meta box (if that feature is enabled and a post format has been registered) . Example, if you add a post with a video, you can choose the video post format when creating your post. Your post will now be displayed using the 'content-video.php' template.

Coming back to your question, you can simply just select the "Standard" option from the post format meta box when you create a post. If you add a post with a video, and you select the "Standard" option, your post will be displayed using 'content.php', and not 'content-video.php' You really don't have to use post formats if you don't want to.

Just one last point of note here. Don't make changes to a theme that you've downloaded and that you are not the author of. The BIG reason been, if you make changes to that theme, and you upgrade that theme in the future, you will loose all your hard work. ALWAYS ALWAYS create a child theme for such themes

EDIT

One point I forgot to mention, remember, the_excerpt() strips all shortcodes and HTML tags, so your videos and audiofiles won't be displayed if you use the_excerpt()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.