Errors with media.php file and functions.php file
-
We have inherited a WordPress site that has a child theme of GeneratePress and has recently started getting some new errors. I reached out to the developer multiple times, but have not gotten a response, so hopefully someone here can point me in the right direction.
- On the homepage, we get “Undefined array key “file” in …/wp-includes/media.php.” There also seems to some kind of padding/spacing issue that’s very obvious on mobile and still very much there on desktop.
- Additionally, when I’m in the dashboard and click on the Pages section I get two errors at the top of the screen that state “Warning: Attempt to read property “ID” on null in …wp-content/themes/generatepress-child/functions.php on line 23” and the same for line 34. Those lines are the following:
Line 23: $acf_fields = get_fields($post->ID);
Lines 32-39 (34 bolded):
wp_localize_script( 'get_floor_plan_js', 'LOCALIZED_DATA', array( 'postId' => $post->ID , 'acfFields' => $acf_fields, 'baseThemeUrl' => get_stylesheet_directory_uri(), 'floorPlansEndpoint' => $urlBase . '/wp-json/wp/v2/floor_plans?per_page=100', ) );As I said earlier, this site was made using a child theme of GeneratePress. It appears that GP Premium was used but the license has run out, so I’m curious if redoing that would clear these up or if there is a bigger problem at play.
Thanks!
The blog I need help with is: (visible only to logged in users)
-
Hi there!
Unfortunately, we cannot assist because your site is not hosted on WordPress.com. It’s a self-hosted WordPress.org site hosted by a different hosting company.
We do not have access to self-hosted sites, so I cannot see the setup of the backend of your account.
To clarify:
- WordPress.com is a managed host platform that offers WordPress in a pre-customized server environment already set up for you to build your site. Hosting with WordPress.com is free, and the server, security, updates, and site optimization are all handled by us. We offer free and paid plans that provide additional features for your site based on your needs (plugins, custom themes, etc). You also have access to professional assistance via Happiness Engineers to address any issues you encounter.
- WordPress.org is a self-hosted platform, meaning you download the WordPress software and install it on a web server from a host of your choosing. You have to pay the host when you’re self-hosting, and the server, security, updates, and site optimization are all handled by you. This gives you more flexibility and control of your plugins, themes, and code but also more responsibility to ensure those things are operating correctly.
Our support page dives more into the differences:
https://en.support.wordpress.com/com-vs-org/
I recommend contacting your site host, as they would be better positioned to assist you since they have access to your account. Also, the open-source forum community is always available and prepared to help users with self-hosted sites: https://wordpress.org/support/forums
-
-
- The topic ‘Errors with media.php file and functions.php file’ is closed to new replies.