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
/** | |
* youtube_embed_url_parameters function. | |
* | |
* @access public | |
* @param string $html | |
* @param string $url | |
* @param array $args | |
* @return string $html | |
*/ | |
function youtube_embed_url_parameters( $html, $url, $args ) { |
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
.section-inner { | |
width:100%; | |
margin: 0 auto; | |
.breakpoint-desktop & { | |
width:60em; | |
background-color: transparent; | |
} | |
} | |
ul.logo-tagline { |
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_register_script('match_media', get_stylesheet_directory_uri().'/js/matchMedia.js', array('jquery')); | |
wp_enqueue_script('match_media'); | |
wp_register_script('metaquery', get_stylesheet_directory_uri().'/js/metaquery.min.js', array('jquery','match_media')); | |
wp_enqueue_script('metaquery'); |
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
<meta media="(max-width: 480px)" content="mobile" name="breakpoint" > | |
<meta media="(min-width: 481px)" content="mobilelarge" name="breakpoint" > | |
<meta media="(max-width: 1024px)" content="mobile-tablet" name="breakpoint" > | |
<meta media="(min-width: 768px)" content="tablet" name="breakpoint" > | |
<meta media="(min-width: 1016px)" content="desktop" name="breakpoint" > |
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 $image_grabbed = substr_replace(get_post_meta($post->ID,{field_key},true), '-150x150', -4, 0); ?> | |
<?php echo $image_grabbed;?> |
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
// Fix pagination for static homepage with augmented query | |
function modify_query($query) { | |
if($query->is_main_query()) { | |
if (! get_query_var('paged')) { | |
$paged = (get_query_var('page')) ? get_query_var('page') : 1; | |
$query->set('paged',$paged); | |
} | |
} | |
} | |
add_action( 'pre_get_posts', 'modify_query' ); |
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 | |
$server = "localhost"; | |
$database = "database"; | |
$username = "user"; | |
$password = "password"; | |
$mysqlConnection = mysql_connect($server, $username, $password); | |
if (!$mysqlConnection) | |
{ | |
echo "Please try later."; |
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 currentTallest = 0, | |
currentRowStart = 0, | |
rowDivs = new Array(), | |
$el, | |
topPosition = 0; | |
$('.blocks').each(function() { | |
$el = $(this); | |
topPostion = $el.position().top; |
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
// Corrects the gallery URL attachment that disallows custom URLS | |
// Use get_post_meta( ATTACHMENT_ID_HERE, '_wp_attachment_url', true ) to retrieve | |
function _save_attachment_url($post, $attachment) { | |
if ( isset($attachment['url']) ) | |
update_post_meta( $post['ID'], '_wp_attachment_url', esc_url_raw($attachment['url']) ); | |
return $post; | |
} | |
add_filter('attachment_fields_to_save', '_save_attachment_url', 10, 2); | |
function _replace_attachment_url($form_fields, $post) { |
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
// stop wordpress from wrapping images in <p> tags | |
function filter_ptags_on_images($content) | |
{ | |
// do a regular expression replace... | |
// find all p tags that have just | |
// <p>maybe some white space<img all stuff up to /> then maybe whitespace </p> | |
// replace it with just the image tag... | |
return preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content); | |
} | |
NewerOlder