• I am having a problem with the following code. The problem appears to be line 507 which is the one that begins with $output. I’ve been going round and round here. I’m trying to link to the current page, but I’m new to php. Please help. I’m feeling so lost here. The error is:
    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /hermes/waloraweb016/b122/as.setoncenter/home/wp-content/themes/priimo/functions.php on line 507

    if(has_post_thumbnail($entry['id'])) {
                $img = get_the_post_thumbnail($entry['id'],'priimo-slide-image');
            } else $img = '<img class="priimo-default-slide" src="'.get_template_directory_uri().'/images/default_slide_image.png"/>';
    	$output .= '<a href='http://www.setoncenterinc.org'></a>'."\n";
        }
        if(trim($output) != '') {
    	$slideshow .= '<div id="coin-slider">'."\n";
            $slideshow .= $output;
            $slideshow .= '</div>'."\n";
        }
        echo $slideshow;
    }
Viewing 1 replies (of 1 total)
  • That line has a single quotes used inside single quotes. You either need to change the outside quotes to double quotes or escape the inside single quotes by preceding each one with a back-slash.

    $output .= "<a href='http://www.setoncenterinc.org'></a>"."\n";

    or

    $output .= '<a href=\'http://www.setoncenterinc.org\'></a>'."\n";
Viewing 1 replies (of 1 total)

The topic ‘unexpected T_CONSTANT_ENCAPSED_STRING’ is closed to new replies.