Skip to content

Instantly share code, notes, and snippets.

Created October 30, 2012 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/8371ce267d480d2b6859 to your computer and use it in GitHub Desktop.
Save anonymous/8371ce267d480d2b6859 to your computer and use it in GitHub Desktop.
// NEW CODE:
// Update the dynamic data if we're on the continents.php page
if ($_SERVER['SCRIPT_NAME'] == '/continents.php')
{
$catDataObj = get_category_by_slug( @$_GET['continent'] );
if ($catDataObj !== false) // check that we have a valid continent value
{
$cid = $catDataObj->term_id;
$filter = array('filter'=>'cats', 'filterDetail'=>'all:' . $cid);
$contentDiv = preg_replace('|<li class="erwpFeaturedPhotos".*?data-filterDetail="[^"]*"|', '<li class="erwpFeaturedPhotos" data-filter="' . $filter['filter'] . '" data-filterDetail="' . $filter['filterDetail'] . '"', $contentDiv);
}
}
// EXISTING CODE:
// Search for dynamic content and replace
$contentDiv = self::replaceDynamicRotatorHTML($contentDiv);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment