Site logo

[Resolved] Helpful Advice to Fix Custom Posts Not Showing

Home Forums Support [Resolved] Helpful Advice to Fix Custom Posts Not Showing

Home Forums Support Helpful Advice to Fix Custom Posts Not Showing

Viewing 15 posts - 1 through 15 (of 27 total)
  • Author
    Posts
  • #1852330
    Ken

    IMPORTANT: I realize that this request may be beyond the scope of GP Support. At least it never hurts to ask right?

    Problem: MY Coach carefully set up Custom Posts. After saving “draft” then clicking on “Preview” only the Title showed up. No content.
    Here’s her feedback:
    ***
    “These are the files I added to the child theme directory:

    single-five_product.php
    content-five_product.php
    single-how_to.php
    content-how_to.php
    single-list_post.php
    content-list_post.php
    single-one_product.php
    content-one_product.php
    single-ten_product.php
    content-ten_product.php
    However, the post content is not displaying when I create one of those posts and Preview it or publish it and view it live.
    I’ve left a One Product Post in draft so that you can see what I mean. If you go in to edit that post and click the Preview button you’ll see that only the title is displayed.

    I did test publishing the post to see if maybe the act of publishing would display the content but that did not work. When I published the post I also ran Chrome Dev Tools on it and can’t see the single-[customposttypename].php and content-[customposttypename].php files being called into action.


    One of the following might be the issue:

    • An installed plugin is causing a conflict with the custom post types
    • The CDN has not updated to include the new templates
    • There’s a missing hook or action that needs to be added to the functions.php file for the child theme (although their custom post type instructions do not mention needing one)
    • The child theme isn’t accurately being called into action (although I tested putting the custom post templates directly in the parent theme and they still didn’t work)
    T• he formatting of the custom post type content in the content-[customposttypename].php file is incorrect (although usually you’d see some funny code on the post that would indicate something was off)

    My next step would be to turn off all plugins except the Advanced Custom Fields and Custom Post Type UI plugins (and any plugins required for SSL) and check again to see if the custom post type content displays.
    ****
    WHAT I’VE DONE:
    I tested the Plugins and Theme.
    As she instructed, all plugins disabled except Advanced Custom Fields, Custom Post Type UI and Simple SSL.
    RESULT:
    When using the Twenty-Twenty Theme only the first paragraph showed up.
    Only the title showed up on both the GP Child & GP Parent theme.

    REQUEST:
    Is there any advice or help that you can offer to help trouble shoot this. I believe it’s a Theme problem because in the Twenty-twenty, at least 1 of two paragraphs showed up.

    Included a link to my site as well a link to the screeshot.

    NOTE: Please look at the “One Product Post” in draft.

    #1852371
    Elvin
    Staff
    Customer Support

    That’s quite a lot to take in. Let’s try to dissect each.

    • An installed plugin is causing a conflict with the custom post types

    I assume you’ve tested this already? Did you make sure the plugins involved are updated? May have to check that as well.

    • The CDN has not updated to include the new templates

    Make sure to temporarily disable and/or purge CDN cache. On top of this, make sure your server doesn’t have some sort of deep cache or page cache. That can have the same effect as a CDN serving a non-updated page.

    • There’s a missing hook or action that needs to be added to the functions.php file for the child theme (although their custom post type instructions do not mention needing one)

    If you didn’t add the_content() within your templates, or have not loaded the proper get_template_part() then that could be an issue. The content comes from the_content() function. If that is missing from the template then there’s no content that would render.

    • The child theme isn’t accurately being called into action (although I tested putting the custom post templates directly in the parent theme and they still didn’t work)

    Can you share the child theme files? Ideally, uploaded on a github repository so we could check the contents? I tried reading it from the backend but there’s no theme editor privileges.

    T• he formatting of the custom post type content in the content-[customposttypename].php file is incorrect (although usually you’d see some funny code on the post that would indicate something was off)

    Can you share any error logs? Or perhaps some screenshots of this? If this “funny code” is an actual PHP or HTML code and not an error log, then that can be a sign of a syntax issue rendering a part of PHP as a string to display on the front end.

    REQUEST:
    Is there any advice or help that you can offer to help trouble shoot this. I believe it’s a Theme problem because in the Twenty-twenty, at least 1 of two paragraphs showed up.

    It’s likely a child theme template problem. 🙂

    #1852456
    Ken

    Wow! Elvin, that is very helpful. Yes, I did the plugins and found no conflicts.
    There’s no CDN that I’m using. However, I did go to Hostinger and under caching purged everything. No change, only the Title is visible.
    I’ll forward this to my coach with notes of what I’ve done. I’ll ask her to send me any error files. But she did mention that she did not see any “funny code” in response to “The formatting of the custom post type content in the ‘content-[customposttypename].php being incorrect. It is correct.

    So it looks like it’s down to two possibilities:
    1. The missing hook she talks about: I’ll ask her to check your suggestion:
    “If you didn’t add the_content() within your templates, or have not loaded the proper get_template_part() then that could be an issue. The content comes from the_content() function. If that is missing from the template then there’s no content that would render.”

    2. The Child Theme isn’t accurately being called into action: I’ll ask her to send me the files and I’ll upload them to github.

    3. I’ll also mention that you feel it’s likely child theme template problem. Not sure where to go to test this or troubleshoot it.

    Thank you for taking the time to break this down and offer up some very helpful advice.
    I’d like to keep this ticket open in case I need more advice.
    Thank you Elvin.

    #1852471
    Elvin
    Staff
    Customer Support

    3. I’ll also mention that you feel it’s likely child theme template problem. Not sure where to go to test this or troubleshoot it.

    It’s a hunch. To be confirmed once we see the template files.

    You can share it through a repository so we can scan through it. 😀

    #1852473
    Ken

    Ah, nice. I got it! thank you. Will try to get the template files and when uploaded to the repository I’ll let you know.
    Thank you! \(*<>*)/

    #1852487
    Ken

    Ah, Elvin, quick question: where in the github to upload these files. I’m a bit of a newbie when it comes to github. I did Google search for github generate press and got 17 public repositories. Which one should I use?

    #1852489
    Ken

    Which github repositery should I use. there’s 17 of them.
    Weird, I got an error posting the previous post. sorry to duplicate it.

    #1852668
    David
    Staff
    Customer Support

    Hi there,

    you would need to create your own GIT Hub repository in order to share those templates with us.
    Alternatively use GIST, to upload one of the single templates and its related content template. Assuming they all use the same structure we don’t need to see them all. GIST is far simpler for sharing individual files.

    #1854899
    Ken

    David, apologies for the late reply.
    Thank you for GIST. I set up a secret repository.
    Problem: My coach is super busy and I don’t know when she’ll be able to upload one of the single templates and it’s related content template.
    Question: Can I do this? Can you tell me where I may find, specifically, the “One Product Post” template and its related content template?
    I have access to my site using FTP, Forklift, a great FTP App.
    Please let me know where I can find these two templates, then I can upload to my GIST and send you the GIST URL.
    Again, thank you folks for your help with this.

    #1854902
    Elvin
    Staff
    Customer Support

    Question: Can I do this? Can you tell me where I may find, specifically, the “One Product Post” template and its related content template?
    I have access to my site using FTP, Forklift, a great FTP App.

    Sure. You can check what child theme is in use on Appearance > Themes or Appearance > Editor. On theme editor you can actually see the theme file contents.

    You can do this on FTP as well. The child theme folder is found on /wp-content/themes/ directory. You should see different folders here including generatepress and the folder of your child theme. When you go into the child theme’s folder you should see all the files you’ve mentioned .:D

    #1854905
    Ken

    Hi Elvin,
    Sorry I don’t see any “editor’
    Here’s a VOD https://share.getcloudapp.com/d5uAk1RG

    #1854906
    Ken

    I’ll go with the FTP and see if that works

    #1854908
    Elvin
    Staff
    Customer Support

    Sorry I don’t see any “editor’

    Ah in that case, it’s likely because the user you’re using doesn’t have privileges to see the theme editor settings shown here – https://share.getcloudapp.com/lluNb5g5

    In your case, FTP is the way to go. 🙂

    #1854909
    Ken

    Hey, I got the files on my computer- your FTP suggestion was spot-on-helpful. I think I just have to copy and paste to GIST. Secret link coming soon. \(*<>*)/

    #1854912
    Ken

    Okay I uploaded the two templates for “One Product Post”. Not sure how to share the link to my GIST, here goes…
    content-one_product.php

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