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 this code to function.php file */ | |
/* Post View Increment */ | |
function rtp_popular_post(){ | |
global $post; | |
$count_key = '_rtp_post_view_count'; | |
if(is_single()){ | |
$view_count = get_post_meta($post->ID, $count_key, true); | |
if($view_count==''){ |
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 this where you want to display popular post sorted by comment count */ | |
$args = array( 'orderby' => 'comment_count', 'numberposts' => $rtp_post_count, 'post_status' => 'publish' ); | |
$posts = get_posts($args); ?> | |
<!-- Output Markup --> | |
<ul class="rtp-most-popular-wrapper"><?php | |
$count=1; | |
for($i=0; $i<sizeof($posts); $i++){?> | |
<li> | |
<a href="<?php echo get_permalink($posts[$i]->ID); ?>" title="<?php echo $posts[$i]->post_title; ?>" target="_blank"><?php echo $count.'. '.$posts[$i]->post_title; ?></a> |
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 | |
$args = array( | |
'numberposts' => 10, | |
'offset' => 0, | |
'category' => 0, | |
'orderby' => 'post_date', | |
'order' => 'DESC', | |
'include' => , | |
'exclude' => , | |
'meta_key' => , |
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 to remove default Widgets from Dashboard */ | |
function remove_dashboard_widgets() { | |
global $wp_meta_boxes; | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']); | |
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); |
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 | |
/* | |
* Remove the WordPress Logo from the WordPress Admin Bar | |
*/ | |
function remove_wp_logo() { | |
global $wp_admin_bar; | |
if(!is_super_admin()){ | |
$wp_admin_bar->remove_menu('wp-logo'); | |
} | |
} |
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 | |
/* Custom Info Admin Bar */ | |
function rtp_role_info() { | |
global $wp_admin_bar, $wpdb; | |
$message = ''; | |
if(current_user_can('basic_contributor')){ | |
$message = "Basic User"; | |
}elseif(current_user_can('premium')){ | |
$message = "Premium User"; | |
} |
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_action('admin_menu','wphidenag'); | |
function wphidenag() { | |
remove_action( 'admin_notices', 'update_nag', 3 ); | |
} | |
?> |
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
jQuery('body').on('click','.topic-checkbox input[type="checkbox"]', function(){ | |
var current_checkbox = jQuery(this); | |
var id = current_checkbox.attr('id'); | |
var checked = current_checkbox.prop('checked'); | |
if(id=="checkbox-input-all" && checked){ | |
jQuery('.topic-checkbox input[type="checkbox"]').prop('checked', true); | |
}else if(id=="checkbox-input-all" && !checked){ | |
jQuery('.topic-checkbox input[type="checkbox"]').prop('checked', false); | |
}else if(id!="checkbox-input-all" && !checked){ | |
jQuery('#checkbox-input-all').prop('checked', 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
https://bitbucket.org/pellepim/jstimezonedetect |
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 | |
function get_country_state_list($c = '',$only_country = FALSE) { | |
$countries = array( | |
'select_one' => __('Select one...', 'rtPanel'), | |
'AF' => __('Afghanistan', 'rtPanel'), | |
'AX' => __('Åland Islands', 'rtPanel'), | |
'AL' => __('Albania', 'rtPanel'), | |
'DZ' => __('Algeria', 'rtPanel'), | |
'AS' => __('American Samoa', 'rtPanel'), | |
'AD' => __('Andorra', 'rtPanel'), |
OlderNewer