• Hi,

    I’ve been receiving an error via the hosting log file that states:

    PHP Warning: array_push() expects parameter 1 to be array, null given in /home/sites/codecmoments.com/public_html/wp-content/themes/gamepress/functions.php on line 13

    This appears to be this section of code in the theme:

    // Set the content width
    if ( ! isset( $content_width ) )
    $content_width = 598; /* pixels */

    function myfeed_request($qv) {
    if (isset($qv[‘feed’]) && !isset($qv[‘post_type’]))
    $qv[‘post_type’] = get_post_types($args = array(
    ‘public’ => true,
    ‘_builtin’ => false
    ));
    array_push($qv[‘post_type’],’post’);
    return $qv;
    }
    add_filter(‘request’, ‘myfeed_request’);

    Specifically line 13:

    array_push($qv[‘post_type’],’post’);

    Any ideas on why this would generate an error? The hosting is suggesting this might be contributing to a recent 500 Internal Server error, though after 18 months of use it’s the first time it’s cropped up.

    Thanks for any advice/help you can give.

  • The topic ‘PHP Warning from function.php’ is closed to new replies.