Skip to content

Instantly share code, notes, and snippets.

@tjhole
tjhole / SHELL: Download and install Wordpress
Created November 3, 2013 13:51
SHELL: Download and install Wordpress
cd /Volumes/DATA/Dropbox/Development/vhosts/development.tjhole.dev
wget http://wordpress.org/latest.tar.gz
tar xfz latest.tar.gz
mv wordpress INSTALLNAME
@tjhole
tjhole / CSS: Foundation Basic
Created November 3, 2013 15:12
CSS: Foundation Style
meta.foundation-mq-small {
font-family: "only screen and (min-width: 768px)";
width: 768px; }
meta.foundation-mq-medium {
font-family: "only screen and (min-width:1280px)";
width: 1280px; }
meta.foundation-mq-large {
font-family: "only screen and (min-width:1440px)";
@tjhole
tjhole / JQUERY: Quick Google Map
Created November 3, 2013 20:32
JQUERY: Quick Google Map
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false">
</script>
<script type="text/javascript">
var $map = jQuery.noConflict();
$map( document ).ready(function() {
var latlng = new google.maps.LatLng(<?php the_field('location_gps');?>);
var myOptions = {
zoom: 17,
center: latlng,
@tjhole
tjhole / ACF: Simple Gallery
Created November 4, 2013 18:25
ACF: Simple Gallery
@tjhole
tjhole / CSS: transition all ease-in-out
Created November 5, 2013 14:47
CSS: transition all ease-in-out
-webkit-transition: all 1s ease-in-out;
-moz-transition: all 1s ease-in-out;
-o-transition: all 1s ease-in-out;
transition: all 1s ease-in-out;
@tjhole
tjhole / WORDPRESS: List categories inside loop
Created November 5, 2013 18:13
WORDPRESS: List caterogies inside loop
<?php $categories = get_the_category(); foreach($categories as $category) { echo $category->name . ' '; } ?>
@tjhole
tjhole / ACF: Repeater
Created November 6, 2013 18:14
ACF: Repeater
<?php if(get_field('repeater_field_name')): ?>
<ul>
<?php while(has_sub_field('repeater_field_name')): ?>
<li>sub_field_1 = <?php the_sub_field('sub_field_1'); ?>, sub_field_2 = <?php the_sub_field('sub_field_2'); ?>, etc</li>
<?php endwhile; ?>
@tjhole
tjhole / ACF: Image
Created November 6, 2013 18:33
ACF: Image
<?php
$attachment_id = get_field('field_name');
$size = "full"; // (thumbnail, medium, large, full or custom size)
$image = wp_get_attachment_image_src( $attachment_id, $size );
// url = $image[0];
// width = $image[1];
// height = $image[2];
?>
<img src="<?php echo $image[0]; ?>" />
@tjhole
tjhole / ACF: Repeater Basic
Created November 7, 2013 16:40
ACF: Repeater Basic
<?php if(get_field('repeater_field_name')): ?>
<ul>
<?php while(has_sub_field('repeater_field_name')): ?>
<li>
<?php the_sub_field('sub_field_1'); ?>
<?php the_sub_field('sub_field_2'); ?>
</li>
@tjhole
tjhole / WORDPRESS: Function - Idiot Proof Admin
Last active November 6, 2019 19:49
WORDPRESS: Function - Idiot Proof Admin
add_action( 'admin_menu', 'adjust_the_wp_menu', 999 );
function adjust_the_wp_menu() {
remove_submenu_page( 'themes.php', 'theme-editor.php');
remove_submenu_page( 'themes.php', 'themes.php');
remove_submenu_page( 'themes.php', 'customize.php');
remove_submenu_page( 'themes.php', 'widgets.php');
remove_submenu_page( 'jetpack', 'jetpack');
remove_submenu_page( 'index.php', 'update-core.php');
}
add_action( 'login_head', 'namespace_login_style' );