• Hi,

    I updated to the most current version of WP and got a fatal error caused by a theme. I removed the lines of code in the theme that were giving me the fatal error and got the admin panel and some of the site back however it seems to be an issue with the short codes in the theme.

    The first line of code I removed that got things back up a little was:
    /**
    * Check the current post for the existence of a short code.
    */
    function has_shortcode( $shortcode = ” ) {

    if ( ! is_404() || ! is_search() ) {

    $post_to_check = get_post(get_the_ID());
    // false because we have to search through the post content first
    $found = false;
    // if no short code was provided, return false
    if ( !$shortcode ) {
    return $found;
    }
    // check the post content for the short code
    if ( stripos($post_to_check->post_content, ‘[‘ . $shortcode) !== false ) {
    // we have found the short code
    $found = true;
    }
    // return our final results
    return $found;

    }
    }

    Now I’m getting this error on my live site all over, and the links are 404ing:

    Warning: Missing argument 2 for has_shortcode(), called in /home/content/c/c/h/cchaput64/html/wp-content/themes/higher-old/functions.php on line 1438 and defined in /home/content/c/c/h/cchaput64/html/wp-includes/shortcodes.php on line 153

    The live site is:
    http://www.christopherchaput.com

    I would really appreciate any help to fix this.

    Thanks!

The topic ‘Updated WP now have issues with theme shortcodes’ is closed to new replies.