Page Error when Post Name Permalink Setup (different from the normal 404)?

General Discussion 6 posts 2 voices

  1. Building a custom theme using the Hybrid Core framework, all seems fine.

    front-page.php fine, custom post type archive pages fine, single-custom_post_type.php all load fine; as well as permalink post name set up.

    However, when setting up a normal page, with or without a page template it doesn’t load front end. Just get the nothing found from the hybrid content.php page i assume its pulling in.
    Looking at the code the body class is .blog within it and the article ID was post-0, which it obviously isn’t, it should be a normal page.

    If i turn off permalink post name and just have default one the page loads fine, turn pretty links back on and it fails again.

    Name of the page varies as well, about page i called page-about.php, about.php, test.php all don’t work.

    Debug on and when i visit ‘Preview Changes’ from the admin i get the following errors, which i don’t get on the live front end.

    This is just a snap shot…

    Notice: Trying to get property of non-object in /home/hp3-linc3-nfs1-w/536/878536/user/htdocs/new/wp-includes/query.php on line 4564
    
    Notice: Trying to get property of non-object in /home/hp3-linc3-nfs1-w/536/878536/user/htdocs/new/wp-includes/query.php on line 4566
    
    Notice: Trying to get property of non-object in /home/hp3-linc3-nfs1-w/536/878536/user/htdocs/new/wp-includes/query.php on line 4568
    
    Notice: Trying to get property of non-object in /home/hp3-linc3-nfs1-w/536/878536/user/htdocs/new/wp-content/themes/Sargy-Mann/hybrid-library/inc/template-hierarchy.php on line 200
    
    Notice: Trying to get property of non-object in /home/hp3-linc3-nfs1-w/536/878536/user/htdocs/new/wp-content/themes/Sargy-Mann/hybrid-library/inc/template-hierarchy.php on line 200
    
    Notice: Trying to get property of non-object in /home/hp3-linc3-nfs1-w/536/878536/user/htdocs/new/wp-content/themes/Sargy-Mann/hybrid-library/inc/template-hierarchy.php on line 203
    
    Notice: Trying to get property of non-object in /home/hp3-linc3-nfs1-w/536/878536/user/htdocs/new/wp-content/themes/Sargy-Mann/hybrid-library/inc/template-hierarchy.php on line 203
    
    Notice: Trying to get property of non-object in /home/hp3-linc3-nfs1-w/536/878536/user/htdocs/new/wp-content/themes/Sargy-Mann/hybrid-library/inc/template-hierarchy.php on line 207
    
    Notice: Trying to get property of non-object in /home/hp3-linc3-nfs1-w/536/878536/user/htdocs/new/wp-content/themes/Sargy-Mann/hybrid-library/inc/template-hierarchy.php on line 210
    
    Notice: Trying to get property of non-object in /home/hp3-linc3-nfs1-w/536/878536/user/htdocs/new/wp-includes/query.php on line 4564
    
    Notice: Trying to get property of non-object in /home/hp3-linc3-nfs1-w/536/878536/user/htdocs/new/wp-includes/query.php on line 4566
    
    Notice: Trying to get property of non-object in /home/hp3-linc3-nfs1-w/536/878536/user/htdocs/new/wp-includes/query.php on line 4568
    
    Notice: Trying to get property of non-object in /home/hp3-linc3-nfs1-w/536/878536/user/htdocs/new/wp-includes/query.php on line 4564
    
    Notice: Trying to get property of non-object in /home/hp3-linc3-nfs1-w/536/878536/user/htdocs/new/wp-includes/query.php on line 4566
    
    Notice: Trying to get property of non-object in /home/hp3-linc3-nfs1-w/536/878536/user/htdocs/new/wp-includes/query.php on line 4568
    
    Notice: Trying to get property of non-object in /home/hp3-linc3-nfs1-w/536/878536/user/htdocs/new/wp-includes/query.php on line 4564
    
    Notice: Trying to get property of non-object in /home/hp3-linc3-nfs1-w/536/878536/user/htdocs/new/wp-includes/query.php on line 4566
    
    Notice: Trying to get property of non-object in /home/hp3-linc3-nfs1-w/536/878536/user/htdocs/new/wp-includes/query.php on line 4568

    I’ve never encountered this problem before as seems separate from the normal 404 error as all other pages load fine with pretty permalinks on, its just pages and i’ve run out of ideas 🙁

  2. This is one of those things where you’ll need to do some trial and error to find out where the issue is coming from.

    1) Disable all plugins on your site. Check if the issue persists. If not, start reactivating them one by one until you can figure out what caused the issue.

    2) If still experiencing the issue, leave plugins disabled and switch to one of the default Twenty* themes.

    From there, we should have an idea of where things might be going wrong. Or, more questions. Let’s test #1 and #2 first.

  3. Thanks Justin.

    I did indeed go through that process and managed to narrow it down to a register custom post type.

    I’ve been using John Blackbourn’s script for registering CPT’s https://github.com/johnbillion/extended-cpts

    Been using for a while with no problems, for some reason one custom post type would cause the above issue with the permalinks. If i hid it and flushed the links the pages would appear.

    Un-hid the CPT that problem would re-appears.

    I did re-name labels and slug for this CPT but not the actual registered name.

    Have you ever encountered a CPT causing a permalink error like this, for any normal page to fail to load?

    Anyway all sorted now, thank you.

  4. Thanks Justin. Do you have one for CPT Taxonomies as well?

    The one above has worked well for me for some times but concurred by this permalink error cropping up again.