Support » Themes and Templates » [Resolved] Custom posts types display in page.php

[Resolved] Custom posts types display in page.php

  • I would really like that Custom Post Type acts like Pages!
    What I want to do is to display this Custom Posts in the page.php

    Any help?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Why not just use pages then?

    Because is a huge site, and I would like to divide the admin panel in different sections in order to make it easy to add content. Also, I want to use Custom Post Types because when I define the post-type, I can easily add custom fields for each kind of post-type. It looks great! I don’t know how could I do this with pages!

    Do you have the post type created already? Are you just wondering how to display the pages? If so, how do you want to display them?

    Its already created and its called ‘product’.
    I want to display post_type = product in pages.php
    Also, Im trying to get the post ID, and if it’s a ‘page’ works fine, but if post_type = product It doesn’t work.

    global $wp_query;
    $thePostID = $wp_query->post->ID;
    $theParentID = $wp_query->post->post_parent;
    $thePostTitle = $wp_query->post->post_title;
    echo "$thePostID";
    echo "$theParentID";

    Thanks Michael, in Custom Post, should I be able to select the template? Because I don’t see the template attribute in my Custom Post Type (I can see it in normal pages).

    No. You have to code the template to display the post type you want.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Resolved] Custom posts types display in page.php’ is closed to new replies.