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' , 'mytheme_remove_normal_excerpt' ); | |
if (!function_exists('mytheme_remove_normal_excerpt')) { | |
function mytheme_remove_normal_excerpt() { | |
remove_meta_box( 'postexcerpt' , 'post' , 'normal' ); | |
} | |
} |
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 | |
if ( !function_exists('mytheme_is_admin_page') ) { | |
function mytheme_is_admin_page($new_edit = null){ | |
global $pagenow; | |
if (!is_admin()) return false; | |
if($new_edit == "edit") { // if is edit post page | |
return in_array( $pagenow, array( 'post.php', ) ); |
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( 'wp_ajax_my_action', 'my_action_callback' ); | |
function my_action_callback() { | |
wp_die(print_r($_POST)); | |
} | |
add_action( 'post_submitbox_misc_actions', 'post_ajax' ); |
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
var iOS8 = navigator.userAgent.match(/(iPad|iPhone|iPod).*OS 8_\d/i); | |
if( iOS8 ){ | |
setTimeout(function(){ | |
$(window).trigger('load'); | |
}, 3500); | |
} |
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( 'wp_enqueue_scripts', 'yourtheme_frontend_scripts'); | |
/********* Frontend Scripts ***********/ | |
if ( ! function_exists( 'yourtheme_frontend_scripts' ) ){ | |
function yourtheme_frontend_scripts() { | |
wp_enqueue_style('yourtheme_google_fonts', yourtheme_fonts_url(), array(), null); | |
} | |
} |
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 | |
/** | |
* Limit file upload size | |
* | |
* For more info about file upload variables check: http://php.net/manual/en/reserved.variables.files.php | |
* For all mime types you can check http://www.freeformatter.com/mime-types-list.html | |
* | |
* @param string $file File for upload | |
*/ |
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 divisible_times($number, $divider) { | |
$count = 0; | |
$remainder = $number % $divider; | |
$num_array = range($number, 1); | |
foreach($num_array as $num) { | |
if($num % $divider == 0){ | |
$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 | |
/** | |
* Custom post type and taxonomy registration | |
* | |
* @since 1.0.0 | |
*/ | |
add_action('init', 'knowledgebase_register_type'); |
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 | |
$content_after_category = get_theme_mod('content_after_category', false); // in Customizer set this as dropdown pages control | |
if($content_after_category){ | |
$page_id = get_page($content_after_category); | |
echo apply_filters('the_content', $page_id->post_content); | |
} | |
?> |