This file contains hidden or 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
/** | |
* Remove Open Sans that WP adds from frontend | |
*/ | |
if (!function_exists('remove_wp_open_sans')) : | |
function remove_wp_open_sans() { | |
wp_deregister_style( 'open-sans' ); | |
wp_register_style( 'open-sans', false ); | |
} | |
add_action('wp_enqueue_scripts', 'remove_wp_open_sans'); | |
// Uncomment below to remove from admin |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Box Shadow</title> | |
<style> | |
.box { | |
height: 150px; | |
width: 300px; | |
margin: 20px; |
This file contains hidden or 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
/** | |
* Check if a page is child of another | |
* Ref: http://bavotasan.com/2011/is_child-conditional-function-for-wordpress/ | |
* | |
* @param mixed $page_id_or_slug Provide the parent ID or Slug | |
* @return bool Whether the page is child or not of the given parent | |
*/ | |
function is_child( $page_id_or_slug ) | |
{ | |
global $post; |
This file contains hidden or 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 | |
/*-----------------------------------------------------------------------------------*/ | |
/* Conditional Logic to Detect Various Event Related Views/Pages | |
/*-----------------------------------------------------------------------------------*/ | |
if( tribe_is_month() && !is_tax() ) { // Month View Page | |
echo 'were on the month view page'; | |
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page |
This file contains hidden or 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
/** | |
* Optimize WooCommerce Scripts | |
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages. | |
*/ | |
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 ); | |
function child_manage_woocommerce_styles() { | |
//remove generator meta tag | |
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) ); |
This file contains hidden or 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.ini hack for increase memory allocation and maximun file upload size | |
## upload this file to wp-admin folder | |
## | |
memory_limit = 256M | |
upload_max_filesize = 64M | |
post_max_size = 64M | |
file_uploads = On | |
max_execution_time = 300 | |
## | |
## |
This file contains hidden or 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 | |
/** | |
* ref : http://www.gravityhelp.com/documentation/page/Embedding_A_Form | |
* Gravity forms embedding in php files | |
* @var boolean | |
*/ | |
gravity_form($id_or_title, $display_title=true, $display_description=true, $display_inactive=false, $field_values=null, $ajax=false, $tabindex); | |
//Usage |
This file contains hidden or 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 | |
// check if the flexible content field has rows of data | |
if( have_rows('sb_blocks') ): | |
// loop through the rows of data | |
while ( have_rows('sb_blocks') ) : the_row(); | |
if( get_row_layout() == 'sbb_image_tile' ): ?> |
This file contains hidden or 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 to add custom favicon in wordpress blog | |
**/ | |
function add_favicon() { | |
$favicon_path = get_template_directory_uri() . '/assets/img/favicon.ico'; | |
echo '<link rel="shortcut icon" href="' . $favicon_path . '" />'; | |
} | |
add_action( 'wp_head', 'add_favicon' ); //front end | |
add_action( 'admin_head', 'add_favicon' ); //admin end |