no admin access with custom theme
-
I’ve inherited a WP site that has a custom theme written about 8 years ago. Very little updates were implemented on this server (running WP 5.1.6 and PHP 5.3). We’re migrating the site to a new server with current releases (WP 5.5.1 and PHP 7.3). Unfortunately, there are a number of deprecated issues within the custom theme and going back to the original developer is not possible.
I’m don’t work with WP or have any background in the use of PHP for websites so I am struggling sometimes with the most basic premises. I do code in python and can get around in html/css – which appears entirely useless here.
I’ve been able to track down and fix a number of the issues and thought I was out of the woods since I was only getting Warnings. But, when I actually closed the interface and then log into the admin page – it just displays the white screen with the following Warnings.
Warning: Declaration of wp_option_choose_color_scheme::render() should be compatible with wp_option::render($field_html, $colspan = false) in /home/usnvc/public_html/wp-content/themes/usnvc/lib/theme-options/choose-color-scheme.php on line 38
Warning: Cannot modify header information – headers already sent by (output started at /home/usnvc/public_html/wp-content/themes/usnvc/lib/theme-options/choose-color-scheme.php:0) in /home/usnvc/public_html/wp-login.php on line 521
Warning: Cannot modify header information – headers already sent by (output started at /home/usnvc/public_html/wp-content/themes/usnvc/lib/theme-options/choose-color-scheme.php:0) in /home/usnvc/public_html/wp-login.php on line 537
Warning: Cannot modify header information – headers already sent by (output started at /home/usnvc/public_html/wp-content/themes/usnvc/lib/theme-options/choose-color-scheme.php:0) in /home/usnvc/public_html/wp-includes/functions.php on line 6270
Warning: Cannot modify header information – headers already sent by (output started at /home/usnvc/public_html/wp-content/themes/usnvc/lib/theme-options/choose-color-scheme.php:0) in /home/usnvc/public_html/wp-includes/pluggable.php on line 958
Warning: Cannot modify header information – headers already sent by (output started at /home/usnvc/public_html/wp-content/themes/usnvc/lib/theme-options/choose-color-scheme.php:0) in /home/usnvc/public_html/wp-includes/pluggable.php on line 959
Warning: Cannot modify header information – headers already sent by (output started at /home/usnvc/public_html/wp-content/themes/usnvc/lib/theme-options/choose-color-scheme.php:0) in /home/usnvc/public_html/wp-includes/pluggable.php on line 960
Warning: Cannot modify header information – headers already sent by (output started at /home/usnvc/public_html/wp-content/themes/usnvc/lib/theme-options/choose-color-scheme.php:0) in /home/usnvc/public_html/wp-includes/pluggable.php on line 1296
Warning: Cannot modify header information – headers already sent by (output started at /home/usnvc/public_html/wp-content/themes/usnvc/lib/theme-options/choose-color-scheme.php:0) in /home/usnvc/public_html/wp-includes/pluggable.php on line 1299
Now I know enough that I’m not going to edit the base files so, clearly, my issue is in the choose-color-scheme.php in the first warning. And clearly, it’s telling me the declaration of wp_option_choose_color_scheme::render() should be compatible with wp_option::render($field_thtml, $colspan = false). My problem is I don’t recognize things in the code.
<?php class color_scheme { var $name; var $colors = array(); function color_scheme($name) { $this->name = $name; } function add_color($hex_code) { $this->colors[] = intval($hex_code, 16); } function add_colors($colors) { foreach ($colors as $color) { $this->add_color($color); } } function get_sorted_colors() { sort($this->colors); $hex_colors = array(); foreach ($this->colors as $decimal) { $hex_colors[] = sprintf('%06X', $decimal); } return $hex_colors; } } class wp_option_choose_color_scheme extends wp_option { var $color_schemes = array(); function add_color_scheme($color_scheme) { $this->color_schemes[] = $color_scheme; } function add_color_schemes($color_schemes) { foreach ($color_schemes as $color_scheme) { $this->add_color_scheme($color_scheme); } } function render() { $html = ''; foreach ($this->color_schemes as $color_scheme) { $html .= '<div class="color-option">'; $checked = ''; if ($this->value==$color_scheme->name) { $checked = 'checked'; } $html .= '<input type="radio" name="' . $this->name . '" ' . $checked . ' class="tog" value="' . $color_scheme->name . '" id="' . $color_scheme->name . '" />'; $html .= '<table class="color-palette">'; $html .= '<tr>'; foreach ($color_scheme->get_sorted_colors() as $color) { $html .= '<td style="background: #' . $color . '"> </td>'; } $html .= '</tr>'; $html .= '</table>'; $html .= '</div>'; $html .= '<label for="' . $color_scheme->name . '">' . $color_scheme->name . '</label>'; } return wp_option::render($html); } } ?>
Any help would be appreciated. I promise to retain what I learn.
- The topic ‘no admin access with custom theme’ is closed to new replies.