• Resolved HJ

    (@coach-henk)


    The main language on the website shows fine. If I switch to the seconde language of the page I get a blank page with the error:

    Warning: preg_match() expects parameter 2 to be string, object given in /home/website/public_html/wp-includes/post-template.php on line 254

    Catchable fatal error: Object of class WP_Post could not be converted to string in /home/website/public_html/wp-includes/post-template.php on line 272

    The code is:

    $content = $pages[$page - 1];
    LINE 254	if ( preg_match( '/<!--more(.*?)?-->/', $content, $matches ) ) {
    		$content = explode( $matches[0], $content, 2 );
    		if ( ! empty( $matches[1] ) && ! empty( $more_link_text ) )
    			$more_link_text = strip_tags( wp_kses_no_null( trim( $matches[1] ) ) );
    
    		$has_teaser = true;
    	} else {
    		$content = array( $content );
    	}
    
    	if ( false !== strpos( $post->post_content, '<!--noteaser-->' ) && ( ! $multipage || $page == 1 ) )
    		$strip_teaser = true;
    
    	$teaser = $content[0];
    
    if ( $more && $strip_teaser && $has_teaser )
    		$teaser = '';
    
    LINE 272	$output .= $teaser;

    If I comment this codeblock out I don’t see the content in neither language, but all the rest is showing on both languages.

    Is this a problem of the multisite language switcher?

    https://ww.wp.xz.cn/plugins/multisite-language-switcher/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Multisite Switcher Error?’ is closed to new replies.