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_action( 'wp_print_scripts', 'my_deregister_javascript', 100 ); | |
function my_deregister_javascript() { | |
if ( !is_page('Contact') ) { | |
wp_deregister_script( 'contact-form-7' ); | |
} | |
} | |
add_action( 'wp_print_styles', 'my_deregister_styles', 100 ); | |
function my_deregister_styles() { | |
if ( !is_page('Contact') ) { | |
wp_deregister_style( 'contact-form-7' ); |
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 getRGB(hex) { | |
if(hex[0] === '#') { | |
hex = hex.substring(1,7); | |
} | |
var r = parseInt(hex.substring(0,2),16); | |
var g = parseInt(hex.substring(2,4),16); | |
var b = parseInt(hex.substring(4,6),16); | |
return 'rgb(' + r + ', ' + g + ', ' + b + ')'; |
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
<div class="container"> | |
<header></header> | |
<section id="hero"></section> | |
<h2>photography & design</h2> | |
<section id="services"> | |
<ul> | |
<li><h3>portraits</h3></li> | |
<li><h3>events</h3></li> | |
<li><h3>maternity</h3></li> | |
<li><h3>promotional</h3></li> |
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 remove_mediaelement_styles() { | |
wp_dequeue_style('wp-mediaelement'); | |
wp_deregister_style('wp-mediaelement'); | |
} | |
add_action( 'wp_print_styles', 'remove_mediaelement_styles' ); |
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
// Limit post revisions to 3 | |
define( 'WP_POST_REVISIONS', 3 ); | |
// Empty trash every 7 days instead of the default 30 | |
define('EMPTY_TRASH_DAYS', 7); |
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
$wp_customize->add_setting( 'themeslug_text_setting_id', array( | |
'capability' => 'edit_theme_options', | |
'default' => 'Lorem Ipsum', | |
'sanitize_callback' => 'sanitize_text_field', | |
) ); | |
$wp_customize->add_control( 'themeslug_text_setting_id', array( | |
'type' => 'text', | |
'section' => 'custom_section', // Add a default or your own section | |
'label' => __( 'Custom Text' ), |
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
$wp_customize->add_setting( 'themeslug_textarea_setting_id', array( | |
'capability' => 'edit_theme_options', | |
'default' => 'Lorem Ipsum Dolor Sit amet', | |
'sanitize_callback' => 'sanitize_textarea_field', | |
) ); | |
$wp_customize->add_control( 'themeslug_textarea_setting_id', array( | |
'type' => 'textarea', | |
'section' => 'custom_section', // // Add a default or your own section | |
'label' => __( 'Custom Text Area' ), |
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
$wp_customize->add_setting( 'date_setting_id', array( | |
'capability' => 'edit_theme_options', | |
'sanitize_callback' => 'themeslug_sanitize_date', | |
) ); | |
$wp_customize->add_control( 'date_setting_id', array( | |
'type' => 'date', | |
'section' => 'custom_section', // Add a default or your own section | |
'label' => __( 'Custom Date' ), | |
'description' => __( 'This is a custom date control.' ), |
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
$wp_customize->add_setting( 'themeslug_url_setting_id', array( | |
'capability' => 'edit_theme_options', | |
'sanitize_callback' => 'themeslug_sanitize_url', | |
) ); | |
$wp_customize->add_control( 'themeslug_url_setting_id', array( | |
'type' => 'url', | |
'section' => 'custom_section', // Add a default or your own section | |
'label' => __( 'Custom URL' ), | |
'description' => __( 'This is a custom url input.' ), |
OlderNewer