Forums

Diffirent post templates for each post type on main page (2 posts)

  1. Eugene.MechanisM
    Member
    Posted 1 year ago #

    I'm using my own theme with Custom Post Type UI and Custom Post Templates Plugins.
    I've created custom post types, and custom templates for each post type(video,text,link,quote,audio and so on.. like tumblr).
    when browsing post, everything looks great and just like i need.
    but when I'm browsing index page with listing all of posts (post types) they have only one template.
    How to list these post types on main page using custom code for each post type?

  2. gr1zzly
    Member
    Posted 1 year ago #

    probably have to edit the 'index.php' template file and use the relevant code blocks for each type of post where you need them.

    If the posts are being displayed dynamically, i.e. you're using the index / home page as the blog front page then conditional statements to test the post type wrapping the relevant output format code should do it.

    OR you can create 'attachment' template file(s) that deal with post with attachments (different ones for different types i.e. image, video etc.)

    Themshaper has a great tutorial on designing a custom WordPress theme, this page has a section on the attachment temeplate.

    hth

Topic Closed

This topic has been closed to new replies.

About this Topic