Custom Post Type Error
-
Hello,
I created a custom post type some time ago. Recently, when I request to display a specific category (associate, residential, commercial) the page returns:
Error thrown
Call to a member function is_singular() on integerWhat is my error and how can I fix it?
Thank you for reading my post!
The page I need help with: [log in to see the link]
-
How did you create the CPT — and how are you displaying it?
Where does this error show up and what does that block of code look like?
If it’s in a theme and you’re unsure of theme development you may have to contact the theme author.
If it’s in a plugin you will have to contact the plugin authors.
How did you create the CPT — and how are you displaying it?
Thank you for your response!
First, I need to apologize. I stated I created the CPT. I did not. A WordPress developer did. I have a ping to him for additional information. (I attempted to correct my post but found no option where I could.)
Second, I am unsure on how to respond to your second question. It is being displayed at the link I provided. If this does not answer your question, please let me know.
Thanks again!
Where does this error show up and what does that block of code look like?
If it’s in a theme and you’re unsure of theme development you may have to contact the theme author.
If it’s in a plugin you will have to contact the plugin authors.
Thank you for your response!
The error appears when you request to display one of the three categories at the top of the paged I linked in my original post. The error code appears on the page that is suppose to display the one category. Does this answer your question?
I do not believe the error is part of the theme because the theme was installed sometime before the CPT was created and theme does not offer the ability to create a CPT.
And I do not believe the error is due to a plugin because if it was, there is not plugin installed that gives the ability to create CPTs.
FYI, I have a ping into the person who created the CPT for additional information.
Thanks again!
I see it now when clicking a category. This will surely require developer intervention and not something that is easily fixable from a user standpoint. Whenever the developer enables debugging it should let them know where exactly the issue lies ( what PHP file and what line ).
One thing you may want to try is head to WordPress Admin -> Settings -> Permalinks -> and simply click the blue save button. This will refresh the permalink, likely won’t solve the issue but worth a shot.
I see it now when clicking a category. This will surely require developer intervention and not something that is easily fixable from a user standpoint. Whenever the developer enables debugging it should let them know where exactly the issue lies ( what PHP file and what line ).
One thing you may want to try is head to WordPress Admin -> Settings -> Permalinks -> and simply click the blue save button. This will refresh the permalink, likely won’t solve the issue but worth a shot.
Thank you for your quick response.
I believed I identified the PHP file where the error code is originating. Do you know how I can identify which line of code where the error resides?
FYI, I tried refreshing the permalink and no change.
If you’re not familiar with PHP I wouldn’t suggest messing with the files. If you find you need to make a child theme and you do not, your changes will be overridden whenever the theme updates.
That being said… If you enable WordPress Debugging ( especially
WP_DEBUG_LOGand checkwp-content/debug.log) then that error may tell you specifically what file and line the issue originates.An easier solution may be to contact a local developer at a local meetup or local WordCamp, possibly your host and see if they can fix this issue.
If you’re not familiar with PHP I wouldn’t suggest messing with the files. If you find you need to make a child theme and you do not, your changes will be overridden whenever the theme updates.
That being said… If you enable WordPress Debugging ( especially WP_DEBUG_LOG and check wp-content/debug.log ) then that error may tell you specifically what file and line the issue originates.
An easier solution may be to contact a local developer at a local meetup or local WordCamp, possibly your host and see if they can fix this issue.
Thank you! Your information was very helpful.
Have a great weekend!
The topic ‘Custom Post Type Error’ is closed to new replies.