Forums

[resolved] single post template for custom post type woes (2 posts)

  1. schmackLab
    Member
    Posted 2 years ago #

    U have created a custom post type (as well as a meta box and a taxonomy) with the code below.

    I have created a single post template for this post type called single-portfolios.php

    When I create a post everything works fine. When I preview the post everything works fine and the content is displayed through the single-portfolios.php file. When I publish it all breaks down and the post is displayed through the default index.php file.

    <iframe src="http://pastebin.com/embed_iframe.php?i=gF0dF1Q2" style="border:none;width:100%"></iframe>

    <script src="http://pastebin.com/embed_js.php?i=gF0dF1Q2"></script>

    Since I obviously cannot seem to embed the code form pastebin here's a link: http://pastebin.com/gF0dF1Q2

  2. schmackLab
    Member
    Posted 2 years ago #

    Found this answer:

    Have you tried going into the Admin going to Settings -> Permalinks and saving? You have to do this to flush the rewrite rules after adding any new ones...which registering a post type does by default.

    Thanks to prettyboymp from reddit.com/r/wordpress

Topic Closed

This topic has been closed to new replies.

About this Topic