2

A client's website has 12 pages, but we can both only see 3 of them, even though we have administrator accounts, and creating a new administrator account does not solve the problem.

Screen Options will not open, and if I check the Chrome console, I see:

Failed to load resource: the server responded with a status of 500 (): /wp-admin/edit.php

I can see /wp-admin/edit.php exists.

I have removed /wp-admin and /wp-includes and uploaded fresh copies of these.

I have uploaded a fresh copy of the parent theme, and the child theme is untouched.

If I rename plugins to plugins.temp the issue remains.

Help appreciated.

EDIT1

If I turn debug on, and reload /wp-admin/edit.php?post_type=page, I see the following errors:

Warning: Illegal string offset 'slideshow' in /home/user/public_html/wp-content/themes/abundance/includes/admin/compat.php on line 48

Fatal error: Uncaught Error: Cannot use string offset as an array in /home/user/public_html/wp-content/themes/abundance/includes/admin/compat.php:48 Stack trace: #0 /home/user/public_html/wp-includes/class-wp-hook.php(298): avia_backend_compatibility_custom_field_filter('', 127) #1 /home/user/public_html/wp-includes/plugin.php(203): WP_Hook->apply_filters('', Array) #2 /home/user/public_html/wp-content/themes/abundance/framework/php/function-set-avia-frontend.php(262): apply_filters('avia_post_meta_...', '', 127) #3 /home/user/public_html/wp-includes/class-wp-hook.php(300): avia_post_meta(Object(WP_Post)) #4 /home/user/public_html/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array) #5 /home/user/public_html/wp-includes/plugin.php(515): WP_Hook->do_action(Array) #6 /home/user/public_html/wp-includes/class-wp-query.php(4070): do_action_ref_array('the_post', Array) #7 /home/user/public_html/wp-includes/query.php(938): WP_Query->setup_postdata(Object(WP_Post)) #8 /home/mag in /home/user/public_html/wp-content/themes/abundance/includes/admin/compat.php on line 48

EDIT2

Here is line 44 to 61 of /abundance/includes/admin/compat.php

function avia_backend_compatibility_custom_field_filter($custom_fields, $post_id)
{
    if(empty($custom_fields))
    {
        $custom_fields['slideshow'][0]['slideshow_image'] = "";
    }

    if(isset($custom_fields['slideshow']) && is_array($custom_fields['slideshow']) && isset($custom_fields['slideshow'][0]['slideshow_image']))
    {
        $post_thumbnail_id = get_post_meta( $post_id, '_thumbnail_id', true );

        if($custom_fields['slideshow'][0]['slideshow_image'] == "" && $post_thumbnail_id)
        {
            $custom_fields['slideshow'][0]['slideshow_image'] = $post_thumbnail_id;
        }
    }
    return $custom_fields;
}
1

2 Answers 2

1
  1. Please open your wp-config.php file and change the parameter like this:

    define('WP_DEBUG', true);
    

Once this parameter is activated, you can see more details about the error.

  1. Try to activate any default WordPress theme like TwentySeventeen and look if the error still exists.

Update:

function avia_backend_compatibility_custom_field_filter($custom_fields, $post_id)
{
    if(empty($custom_fields))
    {
        $custom_fields = array(
             'slideshow' => array(
                 array( 'slideshow_image' => '' )
             )
        );
    }

    if(isset($custom_fields['slideshow']) && is_array($custom_fields['slideshow']) && isset($custom_fields['slideshow'][0]['slideshow_image']))
    {
        $post_thumbnail_id = get_post_meta( $post_id, '_thumbnail_id', true );

        if($custom_fields['slideshow'][0]['slideshow_image'] == "" && $post_thumbnail_id)
        {
            $custom_fields['slideshow'][0]['slideshow_image'] = $post_thumbnail_id;
        }
    }
    return $custom_fields;
}
3
  • Ok, now you can see that the problem is here: /home/user/public_html/wp-content/themes/abundance/includes/admin/compat.php on line 48, you can paste in your question that part of the code (lines 38-58 should be ok) and I will try to help Commented Oct 16, 2017 at 7:21
  • while might be helpful, this is a comment, not an answer.... you have enough rep to commetn ;) Commented Oct 16, 2017 at 7:36
  • I've updated the answer, please try to replace that code and let me know what happens. Commented Oct 16, 2017 at 12:55
0

In my case is was a conflict between two translation plugins, namely WPML and Polylang, while doing a migration. Not sure what was the exact cause since there were no errors shown.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.