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
<!DOCTYPE> | |
<html> | |
<head> | |
<style> | |
#calendar{ | |
width: 336px; | |
display: inline-block; | |
background-color: #000; | |
border: 1px solid #000; | |
} |
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 | |
/** | |
* Search across all network blogs with elasticpress | |
* | |
* @param $scope string Search scope | |
* | |
* @return string | |
*/ | |
function motivast_ep_search_scope( $scope ) { |
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 | |
// Grab the first paragraph, show it where you need it, then take the rest of the content and remove the first paragraph and show it elsewhere | |
// The script uses WordPress functions/content but can be used in any PHP script, just replace the WP functions | |
// First Paragraph | |
global $post; | |
$p1 = wpautop( $post->post_content ); | |
$p1 = substr( $p1, 0, strpos( $p1, '</p>' ) + 4 ); | |
//$p1 = strip_tags($p1, '<a><strong><em><h3><h2><i>'); // in case you need to remove some tags, add the ones you want to KEEP here |
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 | |
// Grab the first paragraph, show it where you need it, then take the rest of the content and remove the first paragraph and show it elsewhere | |
// The script uses WordPress functions/content but can be used in any PHP script, just replace the WP functions | |
// First Paragraph | |
global $post; | |
$p1 = wpautop( $post->post_content ); | |
$p1 = substr( $p1, 0, strpos( $p1, '</p>' ) + 4 ); | |
//$p1 = strip_tags($p1, '<a><strong><em><h3><h2><i>'); // in case you need to remove some tags, add the ones you want to KEEP here |
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
$('.grid').isotope({ | |
itemSelector: '.grid-item', | |
//percentPosition: true, | |
masonry: { | |
columnWidth: 100 | |
} | |
}) |
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 | |
// Place the handles somewhere convenient | |
global $scripts_to_defer, $scripts_to_async, $scripts_origin; | |
$scripts_to_defer = array('fancybox_js', 'bootstrap_js'); | |
$scripts_to_async = array('fontawesome_js'); | |
$scripts_origin = array('fontawesome_js'); | |
// Put this in functions.php | |
function add_defer_attribute($tag, $handle) { |
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 | |
// This will display Gists as if they were real WP posts, so you can display them mixed with real ones too | |
// This will NOT add the Gists as real posts in your DB, you won't see them in your backend | |
/* -------------------------------------- | |
| | |
| Real Posts Loop | |
| | |
|---------------------------------------*/ |
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 | |
// This script assumes we are in a Post Loop | |
// Get the image you need however you like, I use https://github.com/Jany-M/WP-Imager | |
$image_orig = wp_imager($img_w, $img_h, 3, '', true, '', true, null, null, true); | |
// Check for image headers to avoid Error 400 - if all images come always from same server/site you dont need this | |
$userAgent = 'Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0'; | |
$ch = curl_init ($image_orig); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
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 | |
// Flush Cache from Admin bar | |
function flush_memcache_button() { | |
global $wp_admin_bar; | |
// If User isnt even logged in or if admin bar is disabled | |
if ( !is_user_logged_in() || !is_admin_bar_showing() ) | |
return false; |
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 Prefixed to not collide with other LCCC related functions or current plugins and WP Core. | |
function lc_load_custom_wp_admin_style($hook ) { | |
wp_die($hook ); | |
} | |
add_action('admin_enqueue_scripts', 'lc_load_custom_wp_admin_style' ); |