This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//In function.php | |
// For Rewriting the URLS in WORDPRESS | |
add_filter('query_vars', 'add_state_var', 0, 1); | |
function add_state_var($vars){ | |
$vars[] = 'cp'; | |
return $vars; | |
} | |
add_filter('query_vars', 'add_singled_var', 0, 1); | |
function add_singled_var($vars){ | |
$vars[] = 'dcat'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To getting the parent category by slug | |
$digital_post_cat = get_category_by_slug( 'digital-post' ); | |
$digital_post_args = array( | |
'type' => 'post', | |
'child_of' => $digital_post_cat->term_id, | |
'orderby' => 'name', | |
'order' => 'ASC', | |
'hide_empty' => FALSE, | |
'hierarchical' => 1, | |
'taxonomy' => 'category', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function raiseToPower($base,$exponent) | |
{ | |
// multiply the base to itself exponent number of times | |
$result=1; | |
for($i=1;$i<=$exponent;$i++) | |
{ | |
$result = $result * $base; | |
} | |
return $result; | |
} |