Skip to content

Instantly share code, notes, and snippets.

@cfxd
cfxd / flexslider-with-bootstrap-mixins.less
Last active August 29, 2015 14:00
FlexSlider v2.2.0 default styles in LESS
/* Includes Bootstrap mixins!
*********************************/
/* Browser Resets
*********************************/
.flex-container a:active,
.flexslider a:active,
.flex-container a:focus,
.flexslider a:focus { outline: none; }
.slides,
<?php
if (!class_exists('Tax_CTP_Filter')){
/**
* Tax CTP Filter Class
* Simple class to add custom taxonomy dropdown to a custom post type admin edit list
* @author Ohad Raz <admin@bainternet.info>
* @version 0.1
*/
class Tax_CTP_Filter
{
@cfxd
cfxd / selection.less
Last active August 29, 2015 14:03
LESS Mixin to change selection color
.selection(@color; @bg) {
&::selection {
-webkit-font-smoothing: antialiased;
color: @color;
text-shadow: none;
background: @bg;
background: fadeout(@bg, 1%);
}
&::-moz-selection {
-webkit-font-smoothing: antialiased;
@cfxd
cfxd / chosenjs-less-for-bootstrap-and-woocommerce-checkout.less
Last active August 29, 2015 14:03
This will style WooCommerce's ChosenJS select boxes on the WooCommerce checkout page to match your existing Bootstrap form styles (assuming you've made any style changes in LESS) and even replaces the default background images with Bootstrap's built in Glyphicons.
// first some helpful mixins
.abs {
position: absolute;
}
.rel {
position: relative;
}
.position(@top; @right; @bottom; @left) {
top: @top;
right: @right;
<?php
/*
* Plugin Name: AA Test Plugin
* Plugin URI: http://wordpress.org/extend/plugins/test
* Description: Testing all kinds of things!
* Author: Richard Archambault
* Version: 1.0
* License: GPL2+
*/
@cfxd
cfxd / passwordform-bootstrap.php
Last active August 29, 2015 14:04
Roots theme password protected post form function. Use the Bootstrap free markup with the Bootstrap LESS or use the Bootstrap markup version as standalone.
<?php
global $post;
$label = 'pwbox-'.(empty($post->ID) ? rand() : $post->ID);
?>
<form action="<?php echo esc_url(site_url('wp-login.php?action=postpass', 'login_post')); ?>" class="post-password-form form-inline" method="post">
<p><?php _e('This content is password protected. To view it please enter your password below:', 'roots'); ?></p>
<p><label for="<?php echo $label; ?>" class="sr-only"><?php _e('Password:', 'roots'); ?></label></p>
<div class="input-group">
<input name="post_password" id="<?php echo $label; ?>" type="password" placeholder="<?php _e('Enter password', 'roots'); ?>" class="form-control" />
<span class="input-group-btn">
@cfxd
cfxd / remove_cf7_assets-action_hook.php
Last active August 29, 2015 14:04
Load the Contact Form 7 Stylesheet and JavaScript Only When Necessary (the Right Way). See http://cfxdesign.com/load-the-contact-form-7-stylesheet-and-javascript-only-when-necessary/
<?php do_action('cf7_before_wp_head'); ?>
sshexec: {
dump_remote_db: {
options: {
host: '<%= mysql.remote.host %>',
username: '<%= mysql.remote.username %>',
agent: process.env.SSH_AUTH_SOCK
},
command: [
'cd <%= mysql.remote.save_path %>',
'mysqldump <%= mysql.remote.dbname %> -u <%= mysql.remote.dbuser %> -p<%= mysql.remote.dbpass %> > remote-<%= timestamp %>.sql'

require_short_url: some hosts require short URLs otherwise they redirect to a forbidden page

no_rewrite_wysijap: some hosts don't work with the URL rewriting wysijap/subscription bounce_max**: by default, we handle 100 bounce emails per process, with this option you can increase or decrease this value

urlstats_base64: to deactivate base 64 links

no_js_val: no AJAX subscription

allow_no_js: with Wysija, you can register with or without JavaScript. This option deactivates the JavaScript-less option which can be used by spammers

@cfxd
cfxd / wp-cli.txt
Last active August 29, 2015 14:06
# Install wordpress
wp core download && wp core config --dbname=wordpress_test_db --dbuser=root && wp core install --url=http://localhost/wp-cli/ --title=Wordpress --admin_user=admin --admin_password=admin --admin_email=youremail@domain.com
# Install and activate Plugins
wp plugin install wordpress-importer --activate && wp plugin install contact-form-7 --activate
# Generate Posts
curl http://loripsum.wpwolf.com | wp post generate --post_content --count=10
# Activate a theme