Skip to content

Instantly share code, notes, and snippets.

@mattjstrauss
mattjstrauss / gist:8786924
Created February 3, 2014 16:17
ACF: Repeater Field
<?php
if( have_rows('repeater_name') ):
while ( have_rows('repeater_name') ) : the_row(); ?>
<div>
<h1><?php the_sub_field('sub_field_1'); ?></h1>
<?php the_sub_field('sub_field_2'); ?>
<a href="<?php the_sub_field('link'); ?>"><?php the_sub_field('sub_field_3'); ?></a>
@mattjstrauss
mattjstrauss / gist:8786844
Created February 3, 2014 16:12
ACF: if Field
<?php if( get_field('field_name') ): ?>
<?php the_field('field_name'); ?>
<?php endif; ?>
@mattjstrauss
mattjstrauss / Smooth Scrolling
Created September 11, 2013 01:45
This is a simple method to apply smooth scrolling to a website.
$('nav a').on('click', function(){
var sectionId = $(this).attr('href');
$('body').animate({scrollTop: $(sectionID).offset().top}, 'slow');
});
defaults write com.apple.Finder AppleShowAllFiles TRUE
// FOR AUTOMATION (RIGHT CLICK) - GO TO - APPLICATIONS/AUTOMATOR -> CHOOSE SERVICE TEMPLATE -> CHOOSE RUN SHELL SCRIPT -> PASTE IN CODE BELOW -> CHANGE DROP DOWN TO FILES AND FOLDERS -> CHANGE IN APPLICATION TO FINDER -> SAVE AND NAME AS TOGGLE HIDDEN FILES
STATUS=`defaults read com.apple.finder AppleShowAllFiles`
if [ $STATUS == YES ];
then
defaults write com.apple.finder AppleShowAllFiles NO
else
UPDATE wp_options SET option_value = 'http://www.domainfoo.com' WHERE option_name = 'home';
UPDATE wp_options SET option_value = 'http://www.domainfoo.com/bar' WHERE option_name = 'siteurl'
UPDATE wp_posts SET post_content=(REPLACE (post_content, '{old url}','{new url}'))
UPDATE `{new prefix}_usermeta` SET `meta_key` = REPLACE( `meta_key` , '{old prefix}_', '{new prefix}_' ); UPDATE `{new prefix}_options` SET `option_name` = '{new prefix}_user_roles' WHERE `option_name` = '{old prefix}_user_roles';
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'craniumstorm');