WordPress Custom Post Type Functions Effecting Pages - wordpress

ive got a problem which i cant seem to resole I know something in my function.php is causing my pages to cause 404 and cant find the custom template which is required.. Ive tried and searched High and low and still cant find the answer.. if any one can point me in the right direction that would be amazing. Heres my function.php http://pastebin.com/HFjP9cLh
I think its my custom post type which is causing the problem..
Thanks

(Back up your file first)
When all else fails... remove all the functions you recently added. You want to get the site back to when it used to work.
Then slowly add in the missing functions one by one. Slowly you will isolate the issue to just one function.
Then do the same thing within the function. Remove all the lines of code and slowly add in the code until you get the part that is causing the issue. Once you know more of the specifics of what is happening you should have more luck.

I didn't look through all of the code but the first thing you need to do is remove flush_rewrite_rules();. That function should be called once and not every time the page is loaded.
Take it out entirely and then flush your permalinks by going to Settings -> Permalinks in the admin and hitting save.

Related

swiper.js is redirecting my lightbox to the original media URL

The swiper.min.js file that was part of my WordPress them is not allowing any lightbox related plugins on my website to load. When you click on it, you can see the lightbox arrows for a split second, then it redirects to the original media URL. Can someone pinpoint what it is in the swiper.js file that is making this happen. That way I can remove it. I would so appreciate it. I've been spending days trying to figure out what the issue is, and I've finally at least pin pointed that it's coming from swiper.min.js.
Website link where lightbox plugin is used: https://smithspecialized.com/edmonton-drawworks/
I tried removing some things in the file that I thought had something to do with the lightbox redirecting to media URL, but then it broke the code so I think I removed too much, or the incorrect section in the code.
Hey there it's difficult to find any error without accessing website from inside. If don't want to give access then-
please use different plugin or
try to disable and enable plugin, as sometime confliction between plugin caused the issue.

Edit with Wpbakery not working after Wordpress update

I am in big trouble and I am losing my mind. I had to update wordpress, because woocommerce said I can't create variable products anymore. I did and then I noticed that Wp bakery is not working. It loads forever.
I read some topics and tried disabling guttenberg and installing classic editor. It didn't help..
Now the crazy part is that I exported project with all in one migration plugin to other server and it works... It takes a while but it works. How the hell it's possible ?
I still need to fix it and I am getting console error
Uncaught TypeError: window.vc.frame_window.jQuery is not a function
buildFromContent https://shop.marmoarc.com/wp-content/plugins/js_composer/assets/js/dist/frontend-editor.min.js?ver=6.2.0:10
build https://shop.marmoarc.com/wp-content/plugins/js_composer/assets/js/dist/frontend-editor.min.js?ver=6.2.0:10
https://shop.marmoarc.com/wp-content/plugins/js_composer/assets/js/dist/frontend-editor.min.js?ver=6.2.0:10
I really don't understand this stuff and already losing hair(okay I was losing regardless). Please help. :(
Here's what I did, it fixes the issue but can cause certain other issues. For example my page banner doesnt load the first time a user visits the site, but will load every other time.
Get a plugin called Enable jQuery Migrate Helper. It seems to be the only thing that fixes the issue above that you've mentioned.
It will allow you to edit WPbakery elements, but like I said, it may cause other little issues like the aforementioned one above. Of course, if you're not using custom code, this could be the fix you're looking for. Cheers, and good luck.

Installing a new, custom theme has "broke" current Wordpress installation

I've just finished creating a new custom theme based on the underscores framework, and It's ended up breaking my current wordpress installation after applying it.
Although everything is running fine on the front end, the back end is running really weird.
The following issues have presented themselves:
Trying to add a new post (either regular, or one of the new custom post types I've defined) just results in a blank page. Although the post has been created, the admin section gets stuck on the wp-admin/post.php page.
My media library no longer shows up in the media browser. Although all 6,000+ images are still there, none show up.
When logged in, it takes ages for the page to load in the Wordpress admin bar, as it appears it can no longer display the site stats (it just shows the broken image icon after it's finally finished loading in, when the new theme is selected).
I've tried to refresh the permalinks, but this hasn't worked.
Any ideas? I was hoping to re-launch my website today, but it looks like I might have to put it on hold...
Get ahold of the devs for your framework. Your experience is not an uncommon one. It has happened to my sites several times. Unless you want to tweak the php yourself, they will have to help you.
Managed to sort this out. Turns out a function I had written to add a custom field to menu items broke the entire back end. Thanks for the help everyone!

Woocommerce wishlist plugin breaking cookies/cache?

I am working on a woocommerce site right now. I have a plugin for the wishlist that I purchased from Code Canyone here - http://codecanyon.net/item/dvin-woocommerce-wishlist-wp-plugin/1995206
The issue is that when I activate the wishlist plugin I'm no longer able to add multiple items to the cart. It feels like the plugin is breaking the cachce or cookies in some way, and causing it to reset every time you click "add to cart"
I have found that even upon uploading and running without a modified theme or modified plugin in any way that it still doesn't work. I have looked online, but no one else is seeming to have this problem. So it must be me?
I don't get any errors regarding the cache or plugin with debug mode on. (I do get tons of errors for cForms, though. not sure why, but that's another post).
Take a look - http://www.shultzilla.com/admin/shop/sample-product/
Has anyone run into this issue before? Is this a symptom of a specific issue? I have no idea why this would only be happening to me and no one else.
If I deactivate the plugin it works fine, so I'm pretty sure it's something up with this plugin. I've tried to reach out to the developer, but I haven't heard back from him, and Code Canyon says they're not responsible.
Thanks in advance for your help, y'all!
I managed to get ahold of the developer.
Turns out there was a session_start() function that was being called in two files.
He's fixed the issue and it now works.

Wordpress Doesn't Play Nice When Not FIlling in All Fields When Commenting

When someone tries to make a comment on a Wordpress site I have, and they don't fill in all required fields, I get this weird array output which opens in new page:
http://www.screencast.com/users/iamwill/folders/Jing/media/121b2789-b212-4eb3-a4b1-61eed9fb6f52
This is happening on WP 3.0.3, and WPMU 2.9. Any help would be greatly appreciated in finding out the cause of this issue.
From the looks of it, someone forgot a print_r inside the error handling method... you could try finding it and patching it by hand, until an official fix comes around.

Resources