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
jQuery(document).ready(function ($) { | |
'use strict'; | |
function doneResizing() { | |
if (Modernizr.mq('screen and (min-width:768px)')) { | |
// action for screen widths including and above 768 pixels | |
} else if (Modernizr.mq('screen and (max-width:767px)')) { | |
// action for screen widths below 768 pixels | |
} | |
} |
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 | |
$args = array( | |
'post_type' => 'slides', // custom post type | |
'orderby' => 'menu_order', | |
'posts_per_page' => -1 | |
); | |
$slides = new WP_Query( $args ); | |
if ( $slides->have_posts() ) : $count = 0; ?> |
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 | |
// Remove Unecessary Styles & Scripts | |
function h5bs_remove_junk() { | |
if ( ! is_admin() ) : | |
global $WP_Views; | |
remove_action( 'wp_print_styles', array( $WP_Views, 'add_render_css' ) ); | |
wp_dequeue_style( 'views-pagination-style' ); // plugins/wp-views/embedded/res/css/wpv-pagination.css | |
wp_dequeue_style( 'date-picker-style' ); // plugins/wp-views/embedded/res/css/datepicker.css |
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 if ( get_field( 'slides' ) ) : // repeater field ?> | |
<ul class="slider"> | |
<?php while ( the_repeater_field( 'slides' ) ) : | |
$image = get_sub_field( 'slide' ); // sub-field image ID | |
$slide = wp_get_attachment_image_src( $image, 'slides' ); | |
$alt = get_post_meta( $image, '_wp_attachment_image_alt', true ); | |
?> | |
<li><img src="<?php echo $slide[0]; ?>" alt="<?php echo $alt; ?>"></li> | |
<?php endwhile; ?> |
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 | |
function h5bs_enqueue_scripts() { | |
wp_enqueue_script( 'typekit', '//use.typekit.net/xxxxxxx.js' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'h5bs_enqueue_scripts' ); | |
function h5bs_typekit_inline() { |
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 | |
/** | |
* Custom Excerpt | |
* | |
* Needs $word_count set from the template it's being called from | |
* | |
* Template Usage: | |
* | |
* $word_count = 60; | |
* get_template_part( 'parts/excerpt' ); |
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
## Disable mac ._ hidden files | |
$ export COPYFILE_DISABLE=true | |
$ cd directory-name | |
## Filename then path to folder | |
$ tar -cvzf filename.tgz folder-name | |
## Period will zip all files from current directory | |
$ tar -cvzf filename.tgz . |
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 | |
$wp_roles = new WP_Roles(); | |
$names = $wp_roles->get_names(); | |
print_r($names); | |
$wp_roles->remove_role('role_name'); |
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
-- Avoid updating serialized strings with "NOT LIKE '%{%'" | |
UPDATE wp_options SET option_value = REPLACE(option_value, '//olddomain.com', '//newdomain.com') WHERE option_value NOT LIKE '%{%'; | |
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, '//olddomain.com', '//newdomain.com') WHERE meta_value NOT LIKE '%{%'; | |
UPDATE wp_posts SET post_content = REPLACE(post_content, '//olddomain.com', '//newdomain.com') WHERE post_content NOT LIKE '%{%'; | |
UPDATE wp_posts SET guid = REPLACE(guid, '//olddomain.com', '//newdomain.com') WHERE post_type = 'attachment'; | |
-- File paths | |
UPDATE wp_options SET option_value = REPLACE(option_value, '/home/old/path', '/home/new/path') WHERE option_value NOT LIKE '%{%'; | |
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, '/home/old/path', '/home/new/path') WHERE meta_value NOT LIKE '%{%'; |
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 | |
if ( $_GET['file'] ) { | |
exec( 'unzip '.$_GET['file'] ); | |
} | |
else { | |
echo 'Please pass the filename you would like to extract. ex: '.$_SERVER['SCRIPT_URL'].'?file=content.zip'; | |
} | |
// www.example.com/tgz_extractor.php?file=content.tgz |