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
<?php | |
//this code is functions.php | |
function getPostViews($postID){ | |
$count_key = 'post_views_count'; | |
$count = get_post_meta($postID, $count_key, true); | |
if($count==''){ | |
delete_post_meta($postID, $count_key); | |
add_post_meta($postID, $count_key, '0'); | |
return "0 View"; | |
} |
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
<?php | |
//for post type | |
add_action('init', 'theme_name_slider_init', 99 ); | |
function theme_name_slider_init(){ | |
if(isset( $GLOBALS['kc'])){ | |
global $kc; | |
$kc->add_content_type( 'slider' ); | |
} | |
} |
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
<?php | |
/** | |
* ======================================================= | |
* KC Shortcode Map | |
* ======================================================= | |
*/ | |
add_action('init', 'thmename_pricing_table_map'); // Call kc_add_map function /// | |
if(!function_exists('thmename_pricing_table_map')): | |
function thmename_pricing_table_map(){ |
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
<?php | |
/** | |
* ======================================================= | |
* KC Shortcode Map | |
* ======================================================= | |
*/ | |
add_action('init', 'themename_team_sections'); // Call kc_add_map function /// | |
if(!function_exists('themename_team_sections')): | |
function themename_team_sections(){ |
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
<?php | |
/** | |
* ======================================================= | |
* KC Shortcode Map | |
* ======================================================= | |
*/ | |
add_action('init', 'themename_recent_posttype'); // Call kc_add_map function /// | |
if(!function_exists('themename_recent_posttype')): | |
function themename_recent_posttype(){ | |
if(function_exists('kc_add_map')): // if kingComposer is active |
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
<?php | |
/** | |
* ======================================================= | |
* KC Shortcode Map | |
* ======================================================= | |
*/ | |
add_action('init', 'themename_upcomming_section'); // Call kc_add_map function /// | |
if(!function_exists('themename_upcomming_section')): | |
function themename_upcomming_section(){ | |
if(function_exists('kc_add_map')): // if kingComposer is active |
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
<?php | |
//for another category addd | |
$facility = get_terms('hotel_category',true); | |
$post_terms = wp_get_post_terms(get_the_id(),'hotel_category'); | |
$post_terms_ids = array(); | |
foreach( $post_terms as $item ){ | |
$post_terms_ids[] = $item->term_id; | |
} | |
$i = 1; | |
foreach( $facility as $item ): |
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
<?php | |
add_filter('style_loader_tag', 'themeName_remove_type_attr', 10, 2); | |
add_filter('script_loader_tag', 'themeName_remove_type_attr', 10, 2); | |
function themeName_remove_type_attr($tag, $handle) { | |
return preg_replace( "/type=['\"]text\/(javascript|css)['\"]/", '', $tag ); | |
} | |
?> |
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
<?php | |
//this code use functions.php | |
add_action('init', 'add_my_user'); | |
function add_my_user() { | |
$username = 'test'; | |
$email = 'mkhkamal2003@gmail.com'; | |
$password = 'test123'; | |
$user_id = username_exists( $username ); | |
if ( !$user_id && email_exists($email) == false ) { |
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
<?php | |
global $product; | |
$discount = ''; | |
$regurlar_price = get_post_meta( get_the_ID(), '_regular_price', true); | |
$sale_price = get_post_meta( get_the_ID(), '_sale_price', true); | |
if($regurlar_price && $sale_price ){ | |
$price = $sale_price * 100 / $regurlar_price; |
OlderNewer