Skip to content

Instantly share code, notes, and snippets.

@olkunmustafa
Last active April 7, 2016 09:52
Show Gist options
  • Save olkunmustafa/279bbe7d0d733b89585b933a8f2b333f to your computer and use it in GitHub Desktop.
Save olkunmustafa/279bbe7d0d733b89585b933a8f2b333f to your computer and use it in GitHub Desktop.
<?php
if ( is_category() ) {
echo "<script>console.log( 'Cat ID : " . $cat . "' )</script>";
}
?>
<?php
if ( is_category() ) {
$category = get_the_category( $cat );
$parent = $category[0]->category_parent;
switch( $parent ){
case 5:
echo "<script>console.log( 'Parent No 5 olan reklam modeli' )</script>";
break;
}
}
?>
<?php
if ( is_category() ) {
switch ( $cat ) {
case 45:
case 46:
case 47:
echo "<script>console.log( 'Reklam Modeli 1' )</script>";
break;
case 48:
case 49:
case 50:
echo "<script>console.log( 'Reklam Modeli 2' )</script>";
break;
default:
echo "<script>console.log( 'Reklam Modeli Default' )</script>";
break;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment