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
//Creating Custom Post types for Team | |
function setup_team_cpt(){ | |
$labels = array( | |
'name' => _x('team', 'post type general name'), | |
'singular_name' => _x('team', 'post type singular name'), | |
'add_new' => _x('Add New', 'Team'), | |
'add_new_item' => __('Add New Team'), | |
'edit_item' => __('Edit Team'), | |
'new_item' => __('New Team'), | |
'all_items' => __('All Team'), |
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 disable_wp_emojicons() { | |
// all actions related to emojis | |
remove_action( 'admin_print_styles', 'print_emoji_styles' ); | |
remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
remove_action( 'wp_print_styles', 'print_emoji_styles' ); | |
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); | |
remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); | |
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); |
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
//Trm excerpt | |
function berglund_trim_excerpt($length) { | |
global $post; | |
$explicit_excerpt = $post->post_excerpt; | |
if ('' == $explicit_excerpt) { | |
$text = get_the_content(''); | |
$text = apply_filters('the_content', $text); | |
$text = str_replace(']]>', ']]>', $text); | |
} else { | |
$text = apply_filters('the_content', $explicit_excerpt); |
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
/** | |
* Media - set default image link location to 'None' | |
*/ | |
update_option('image_default_link_type','none'); | |
/** | |
* Always Show Kitchen Sink in WYSIWYG Editor | |
*/ |
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
//Creating Custom Post types for work | |
function setup_work_cpt(){ | |
$labels = array( | |
'name' => _x('work', 'post type general name'), | |
'singular_name' => _x('work', 'post type singular name'), | |
'add_new' => _x('Add New', 'work'), | |
'add_new_item' => __('Add New work'), | |
'edit_item' => __('Edit work'), | |
'new_item' => __('New work'), | |
'all_items' => __('All work'), |
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 theme_setup() { | |
add_theme_support('post-thumbnails'); // adds thumbnail support for the pages, posts and Projects CPT | |
add_image_size('work_cat_thumb', 800, 500, true); | |
add_image_size('post_thumbnail', 600, 250, true); | |
add_image_size('post_thumbnail_1', 70, 70, true); | |
// Register menus | |
register_nav_menus(array( |
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
/** | |
* Including all required style files in the theme | |
*/ | |
function theme_styles() { | |
wp_register_style('bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.css', array(), '1', 'all' ); | |
wp_register_style('font-awesome.min', get_template_directory_uri() .'/assets/css/font-awesome.css', array(), null, 'all' ); | |
wp_register_style('simple-line-icons', get_template_directory_uri() .'/assets/css/simple-line-icons.css', array(), null, 'all' ); | |
wp_register_style('elegant-icons', get_template_directory_uri() .'/assets/css/elegant-icons.css', array(), null, 'all' ); | |
wp_register_style('animate', get_template_directory_uri() .'/assets/css/animate.min.css', array(), null, 'all' ); | |
wp_register_style('animsition', get_template_directory_uri() .'/assets/css/animsition.min.css', array(), null, 'all' ); |
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
# ----------------------------------------------------------------- | |
# .gitignore for WordPress | |
# Bare Minimum Git | |
# http://ironco.de/bare-minimum-git/ | |
# ver 20150227 | |
# | |
# This file is tailored for a WordPress project | |
# using the default directory structure | |
# | |
# This file specifies intentionally untracked files to ignore |
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
/* Change shipping based on cart total and if they they qualify for free shipping */ | |
add_filter( 'woocommerce_package_rates', 'hide_flat_rate_if_cart_total_is_greater_than_threshold', 5, 1 ); | |
function hide_flat_rate_if_cart_total_is_greater_than_threshold( $rates ) { | |
$threshold1 = 249; | |
$amount = WC()->cart->cart_contents_total; | |
if ( $amount > $threshold1 ) { | |
unset( $rates['flat_rate:5'] ); | |
} | |
return $rates; | |
} |
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
add_filter( 'woocommerce_package_rates', 'hide_shipping_when_free_is_available', 100 ); | |
function hide_shipping_when_free_is_available( $rates ) { | |
$free = array(); | |
foreach ( $rates as $rate_id => $rate ) { | |
if ( 'free_shipping' === $rate->method_id ) { | |
$free[ $rate_id ] = $rate; | |
break; | |
} | |
} | |
return ! empty( $free ) ? $free : $rates; |
OlderNewer