create template for custom post type

  • Author
    Posts
  • #34381
    kelaskakap

    hi,
    nirvana is very beautiful, advanced free theme, love it. so.. i create custom post type “wisata”, how to create custom post template for “wisata”?
    i’ve created file “single-wisata.php” then copy the codes of “single.php” into “single-wisata.php”, but when i tried to view my post, it show me “page not found”

    how to create template for my custom post type?

    thank you.

    #34453
    Zed
    Cryout Creations mastermind

    Wordpress follows the Template Hierarchy in picking the appropriate file for rendering.

    Double check your registered post type (first parameter of register_post_type()) is the same word you use in the filenames.

    If you’re using pretty URLs (permalinks), you’ll also need to create rewrite rules for WordPress to know when to use the custom post type templates. I suggest testing with simple links (?post_id=X) first.


    If you like our creations, help us share by rating them on WordPress.org.
    Please check the available documentation and search the forums before starting a topic.
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘create template for custom post type’ is closed to new replies.