Your if statment is using an alternative syntax so it needs to be in the following structure which changes the standard opening brace {
to a colon :
and the closing brace }
to endif;
if ($post_object):
// Code if true
else:
// Code if false
endif
I’m not sure this will fully fix your problem as there could be different PHP versions on the new server with deprecated functions in the theme, but it should help.
Related Posts:
- website returning random 504 and 502 errors
- WordPress HTTP 500 Error
- Google Search Console: Index Coverage Error for /wp-includes/ php files
- 500 error on front-end but not on admin
- 500 internal server error
- Debug 500 Internal Server Error on WordPress blog
- /wp-admin/admin-ajax.php Error 500
- unexpected ‘$mm’ (T_VARIABLE) in wp-includes/functions.php
- Function prints post meta data does not work [closed]
- General 500 error from the root
- WordPress Core is causing 500 internal server error
- HTTP error 500 in a small WordPress site
- Encountered Internal Server Error No 500 with four possibilities
- I changed a server and a domain in the same time and the site brings error 500 in the browser
- Timthumb error 500 on multiple requests – not on single load
- Whats is the meaning of this error 500
- Site no longer working following server crash – how to restore it
- SERVER ERROR (wp-admin urls won’t load, site will)
- Internal Server Error upon installation
- Post SMTP: Fatal error: Allowed memory size … exhausted
- Internal server issue while generating the access token
- How to create custom 401, 403 and 500 error pages?
- Easy code troubleshooting in wordpress
- Why is a 500 error generated by admin-ajax.php not going into the Apache error log?
- Troubleshooting a Network site displaying a blank page [closed]
- What might cause a POST to wp-admin/async-upload.php to return JSON >and< HTML?
- Plugin screenshots not showing in the repository
- .htaccess and 500 error, extra character added
- get_template_directory_uri() and other URL tags not working in theme
- W3 Total Cache active but not working [closed]
- WooCommerce – Call to undefined function is_woocommerce()
- How to solve a conflict between a plugin and a theme?
- .htaccess file redirecting to parent directory
- Calling a wp_query $posts causes a 500 error
- Troubleshooting fetch_feed and SimplePie
- WordPress Errors? Update Failed! data.min.js
- 500 Internal Server Error after attempting to switch from subdirectory to addon domain
- How do I change the description of the same image which is to be found in multiple instances?
- Can’t access wp-admin Internal Server Error 500
- Forgot password not working
- Error Logs to Diagnose Error 500 in LAMP
- Why does the custom HTML block not preserve the HTML characters?
- 500 Internal Server Error after Register dialog, but with successful registration
- 500 Internal server error after changing php version
- Activating Child Theme Breaks Website, Blank Page, Error 500
- Getting a 500 internal server error ONLY on wp-admin/options-permalink.php
- Why is save_post hook not running?
- How to stop a 500 error on the WordPress theme folder
- How can I reactivate a plugin without access to my dashboard?
- Error in Validate Field with ACF plugin in WordPress
- Using the child theme functions.php to change the customizer.php on parent theme
- How to get a Custom 500 Error Page to show?
- wp_generate_attachment_metadata generates 503 Service Unavailable or 500 timeout errors
- get_home_path() returning error 500
- Widgets not expanding on wordpress 3.3 widget dashbord
- Find source of notice / warning / errors efficiently
- PHP Fatal error: Call to undefined function WP_Filesystem() [closed]
- Copying wordpress to another server breaks it on original server
- 500 Internal Server Error when updating htaccess
- How to solve 500 Error on WordPress Admin Dashboard due to time-out on getdirsize
- Unable to access website admin page – 500 error – how to change landing page
- White Blank Page when Updating and Publishing Page/Post
- APC 500 Internal server error [closed]
- How to show the error causing the ‘There has been a critical error on your website’?
- Nginx 404, 500 errors and WordPress
- Meta Query Array Error 500
- Divi Child Theme not appearing in “Themes” [closed]
- /wp-admin/ 500 error
- do_action and add_action on two different installed plugins won’t work
- I just got my domain vsmathur.co.in verified by Google Domains, but cannot access my WordPress site, Help! [closed]
- async_upload.php 500 Error when Uploading larger files with slow internet connection and latency
- GET parent theme throws 500 error in console, site works fine
- I got an issue after i migrated a site
- Masonry images not working
- WordPress 502 | Header Upstream send too big
- How to Fix “Are You Sure You Want to Do This”, while uploading my theme?
- Take input from form and pass it to function using a wp-plugin
- My Homepage Suddenly Disappeared and I Can’t Get It Back
- Having wordpress page accesss issue under sub-directory
- Unable to edit the “customize” section and the “widget” section is populating unknown code
- Blog page Server error 500 with stick post loop in query.php
- Redirect to localhost after installing Multisite on server
- How do I Turn This Into An if statement?
- WordPress 500 Internal server error when activating custom theme [closed]
- Image Upload HTTP 500 Internal server error
- Blog posts not displaying
- Post thumbnails not working in my new install of WP 3.1 with Twenty Ten theme
- My WordPress website was hacked [closed]
- 500 error after update
- PHP Fatal error: Call to a member function locale() on a non-object
- Derive child theme from separate theme
- Plugin PHP file gives error 500 [closed]
- long delay before loading website because of wp_footer()
- WordPress 4.9.8 doesn’t save if content has style=”
- How to direct user after comment save
- HTTP 500 error after plugin install
- Getting HTTP error 500 after migrating a website
- Website goes down while importing backup (Internal server 500)
- Text of posts is suddenly not visible anymore [closed]
- qtranslate arabic shortcode?