[Resolved] I have created a custom post type, how do I load its content

Home Forums Support [Resolved] I have created a custom post type, how do I load its content

Home Forums Support I have created a custom post type, how do I load its content

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
  • #2570789

    I have created a custom post type, how do I load its content, I have made a template into a plug-in, which is convenient for maintenance, how do I do it?


    But, If you do not create a specific template, then WP would use the themes single.php.
    Then you can use a Block element Content Template to design the CPT, by setting the Display Rules Location to the Custom Post Type Name.
    This methods means you don’t require a custom template unless there are code specific things you need to change.”


    I saw this answer in this post. This is what I want. I just want to display the default GP theme template, but I don’t know how to set it up. If I need to add code, I hope it will be added to the custom plugin. If not, add it code, that’s even better. Because you don’t want to break your custom code by updating.


    By the way, I need to add products and pages, and I want to manage products separately, so I just registered the new post type, if there is another way that is better, please let me know.

    Customer Support

    Hi there,

    you can try using the Block Element – Content Template.


    1, go to Appearance > Elements –> Add New —> Block Element.
    2. set the Element Type to Content Template
    3. In the editor add a Post Content block.
    4. Set the Display Rules -> Location to your single post type.
    5. Publish this.

    Then check if it shows your posts.
    If it does you can edit the block element and design it and add other dynamic data as you need.


    I’m a little dizzy looking at it, the documentation is too simple, I know that you can use element block positioning to make different templates, which works great.

    However, I’m still figuring it out, like if I want to create a new menu and post type for others to use, how do I set this field only?

    I looked at the settings and it seems that only terms and custom fields can be used.
    Don’t see custom post types.


    I have to say the design is really cool. But the usage docs are terrible. I’m not smart enough to know all of its features just by looking at a little description. Hahaha

    Customer Support

    The Block Element is only means to displaying the content ie. you are making a template to display your data.
    What it cannot do is create the fields you may need on your custom post type.

    Did you follow the steps i provided above? And did you see any thing on your custom post types ?


    Opening the link before I set it shows 404

    I do this step:
    【4. Set the Display Rules -> Location to your single post type.】

    But the page will now 301 to the homepage.

    I don’t know where I went wrong, hahaha.


    I tried the steps on a test site, all ok. Now we can know that it is not a gp problem.


    I know the problem, I set the data, and then 404, but rank math gave it 301 (I have confirmed that the 301 function is turned off, but it still automatically 301, which makes me don’t know why this happens, after After checking, only this plugin has this function, I uninstalled it. Now everything is fine.)

    My problem solved, GPP is awesome, it does what I want, I’ve removed the 3 plugins I had to install before, it’s great.

    I don’t know where these configuration options can be used, can you tell me.

    Tag name
    Select the tag names to apply to the content template.

    Apply to
    Set the condition which the content template is applied to.

    Customer Support

    Glad to hear that 🙂

    Tag Name: this changes the HTML wrapper of your template it defaults as <article> and in most cases you can leave it as is.

    Apply to: for most cases and particulary a single post you can leave that on the default All posts.

    For more complex scenarios on say an archive page, you can create a template that only applies to the first post or posts with a specific term, allowing you to mix content templates. See here for an example:



    Thank you so much. This solved my problem.

    Customer Support
Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.