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
.social-bar { | |
position: fixed; | |
left: 0; | |
top: 260px; | |
font-size: 1.5em; | |
z-index: 1000; | |
} | |
.social-bar.horizontal { | |
bottom: 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
<div class="hidden-xs social-bar horizontal"> | |
<ul class="social-buttons"> | |
<li class="linkedin first"> | |
<a target="_blank" href="http://www.linkedin.com/shareArticle?mini=true&url={articleUrl}&title={articleTitle}&summary={articleSummary}&source={articleSource}" title="Share on LinkedIn"><span class="fa fa-linkedin"></span></a> | |
</li> | |
<li class="twitter"> | |
<a href="#" title="Share on Twitter"><span class="fa fa-twitter"></span></a> | |
</li> | |
<li class="facebook"> | |
<a href="#" title="Share on Facebook"><span class="fa fa-facebook"></span></a> |
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
/** | |
* Echoes a pretty timestamp if the post is younger than max_days. | |
* Must be used inside the loop. | |
* | |
* Examples: | |
* - Posted 3 days ago | |
* - Posted 12 hours ago | |
* - Posted 5 minutes ago | |
* - Posted just now (less than a minute ago) | |
* - 2014-07-25 08:33:54 (post is older than $max_days) |
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 force_login() { | |
if ( ! is_user_logged_in() ) { | |
wp_safe_redirect( wp_login_url(), 301 ); | |
exit(); | |
} | |
} | |
add_action( 'template_redirect', 'force_login' ); |
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 | |
add_filter( 'check_less_compile', function( $value ) { | |
if ( defined( 'KEYSTONE_CACHE_BUST' ) && KEYSTONE_CACHE_BUST ) { | |
$less_cache_bust = get_option( 'less_cache_bust', false ); | |
if ( $less_cache_bust === KEYSTONE_CACHE_BUST ) { | |
$value = false; | |
} else { | |
update_option( 'less_cache_bust', KEYSTONE_CACHE_BUST ); |
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($) { | |
$.ajax({ | |
url: ajaxurl, | |
action: 'my_wp_ajax_action' | |
}) | |
.success(function(response) { | |
if (typeof response.success === 'undefined') { | |
// undefined error | |
} else if (response.success === false) { |
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
$(document).on('click', 'keystone_newsletter_delete_image', function(event) { | |
var image = $('#'+$(this).attr('data-image')); | |
var input = $('#'+$(this).attr('data-input')); | |
input.val(''); | |
image.attr('src',''); | |
}); |
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
vagrant ssh | |
cd /opt | |
sudo wget -c http://download.virtualbox.org/virtualbox/5.0.2/VBoxGuestAdditions_5.0.2.iso -O VBoxGuestAdditions_5.0.2.iso | |
sudo mount VBoxGuestAdditions_5.0.2.iso -o loop /mnt | |
cd /mnt | |
sudo sh VBoxLinuxAdditions.run --nox11 | |
cd /opt | |
sudo /etc/init.d/vboxadd setup | |
sudo chkconfig --add vboxadd | |
sudo chkconfig vboxadd on |
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
cd /path/to/root | |
for url in $(wp site list --field=domain) | |
do | |
echo ${url} | |
wp --url=${url} option update db_version 30133 | |
echo | |
done | |
wp --url=${url} core update-db --network |
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
cd /path/to/root | |
for id in $(wp site list --field=blog_id) | |
do | |
echo ${id} | |
mysql -h##HOST## -u##USER## -p##PASSWORD## -e "DELETE FROM wp_${id}_postmeta WHERE meta_key LIKE '_oembed_%' and meta_key NOT LIKE '_oembed_time_%' and meta_value NOT LIKE '%>' AND meta_value != '{{unknown}}';" ##DB_NAME## | |
echo Flushed dodgy OEmbeds from site ${id} | |
done |
OlderNewer