{PUBLISHER} = accreditedschoolsonline.org
{PARAMS} = &backgroundColor=%232dade4&cta=FIND%20ONLINE%20COLLEGES&ctaColor=%23fe3d00&height=325&title=FIND%20PROGRAMS&titleColor=%23363636
{PUBLISHER} = affordablecollegesonline.org
{PARAMS} = &backgroundColor=%23ffffff&cta=SEE%20AFFORDABLE%20SCHOOLS&ctaColor=%23fe3d00&height=325&title=FIND%20PROGRAMS&titleColor=%233299a9
<?php
/**
* SSR Platform Widget Request
*/
function he_ssr_platform_js($url, $publisher)
{
// Publisher required, fail otherwise.
if (empty($publisher)) {
throw new \Exception('No publisher domain provided');
}
// Query params.
$qsa = http_build_query([
'publisher' => $publisher,
'url' => 'https://www.' . $publisher . $_SERVER['REQUEST_URI']
]);
$url = strpos($url, '?') === false ? "{$url}?{$qsa}" : "{$url}&{$qsa}";
// Curl
$ch = curl_init($url);
if ($ch) {
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$js = curl_exec($ch);
curl_close($ch);
return $js;
}
return false;
}
?>
<?php
echo he_ssr_platform_js(
'https://platform.highereducation.com/widgets.html?widget=ssr-qdf{PARAMS}',
{PUBLISHER}
);
?>
When replacing the Widget markup, keep in mind the only styles you'll need to keep from the previous widget are the widgets positioning/location styles or you may even stick the widget inside the parent widget container that controls the positioning/location of the widget. e.g. affordablecollegesonline.org
<div id="mob_widget_popup" class="" style="min-height: 572px;">
<?php
echo he_ssr_platform_js(
'https://platform.highereducation.com/widgets.html?widget=ssr-qdf&backgroundColor=%23ffffff&cta=SEE%20AFFORDABLE%20SCHOOLS&ctaColor=%23fe3d00&height=325&title=FIND%20PROGRAMS&titleColor=%233299a9',
affordablecollegesonline.org
);
?>
</div>
Feel free to remove any and all widget styles/js that are no longer needed to cleanup theme. Replacing the form may cause existing JS functionality to fail if events are attached to the existing widget.
accreditedschoolsonline.org