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 Quries for Responsivness*/ | |
/* Landscape tablets and medium desktops */ | |
@media (min-width: 992px) and (max-width: 1199px) { | |
} | |
/* Portrait tablets and small desktops */ | |
@media (min-width: 768px) and (max-width: 991px) { |
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 # -*- coding: utf-8 -*- | |
namespace WPSE; | |
/* Plugin Name: Fast Next/Prev Post Links | |
* Plugin URI: http://wordpress.stackexchange.com/q/101435/ | |
*/ | |
add_action( | |
'fast_prev_post_link', | |
__NAMESPACE__ . '\fast_prev_post_link', | |
10, |
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
delete a, b, c | |
FROM wp_posts a | |
LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id ) | |
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id ) | |
LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id = b.term_taxonomy_id ) | |
LEFT JOIN wp_terms e ON ( e.term_id = d.term_id ) | |
WHERE e.term_id IN (10) | |
AND a.post_type = 'post' | |
AND a.post_date BETWEEN '2008-01-01' AND '2013-01-15'; |
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 mandatory_excerpt($data) { | |
$excerpt = $data['post_excerpt']; | |
if (empty($excerpt)) { | |
if ($data['post_status'] === 'publish') { | |
add_filter('redirect_post_location', 'excerpt_error_message_redirect', '99'); | |
} |
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
/* force page to load on top - cause of refresh */ | |
$(window).on('beforeunload', function(){ | |
$(window).scrollTop(0); | |
}); |
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 THEMENAME_wrap_gumby_intrinsic($html, $url, $args){ | |
$provider = ''; | |
if (preg_match("#https?://youtu\.be/.*#i", $url) || preg_match("#https?://(www\.)?youtube\.com/watch.*#i", $url)) { | |
$provider = 'youtube'; | |
}elseif (preg_match("/vimeo.com\/([^&]+)/i", $url)) { | |
$provider = 'vimeo'; | |
} | |
//no oEmbed for Twich :< | |
//elseif (preg_match("/https?:\/\/(.*twitch\.tv\/.*|.*twitch\.tv\/.*\/b\/.*)/i", $url)){ | |
//$provider = 'twitch'; |
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 | |
/* | |
Plugin Name: Remove All Feeds [for WPSE33072] | |
Description: Remove all feeds from WordPress | |
Author: Christopher Davis | |
Author URI: http://christopherdavis.me | |
License: GPL2 | |
*/ | |
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 nsppt_remove_cpt_slug( $post_link, $post, $leavename ) { | |
if ( ! in_array( $post->post_type, array( 'portfolio' ) ) || 'publish' != $post->post_status ) | |
return $post_link; | |
$post_link = str_replace( '/' . $post->post_type . '/', '/', $post_link ); | |
return $post_link; | |
} | |
add_filter( 'post_type_link', 'nsppt_remove_cpt_slug', 10, 3 ); | |
/** | |
* Some hackery to have WordPress match postname to any of our public post types | |
* All of our public post types can have /post-name/ as the slug, so they better be unique across all posts |
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
// Use the new media manager to handle uploads to Soliloquy. | |
$('#soliloquy-area').on('click.soliloquyUpload', '#soliloquy-upload', function(e){ | |
// Prevent the default action from occuring. | |
e.preventDefault(); | |
// Variable to hold our media applicaton. | |
var soliloquy_frame; | |
// If the media frame already exists, reopen it and return. | |
if ( soliloquy_frame ) { |
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 | |
/** | |
* Register Widget Area. | |
* | |
*/ | |
function wpgyan_widgets_init() { | |
register_sidebar( array( | |
'name' => 'Header Sidebar', |
NewerOlder