Skip to content

Instantly share code, notes, and snippets.

@GregWallace
GregWallace / wp-config.php
Created August 27, 2015 06:45
Increase WordPress memory limit in wp-config
<?php
/* Increase memory limit for WordPress
** Codex: https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP */
define( 'WP_MEMORY_LIMIT', '96M' );
@GregWallace
GregWallace / 0_reuse_code.js
Last active August 29, 2015 14:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@GregWallace
GregWallace / style.css
Created October 28, 2014 15:44
Remove padding from bottom of image
img {
display: block; // works - use this first
// vertical-align: bottom // also suggested as an alternative
}
@GregWallace
GregWallace / ie-style.css
Created October 28, 2014 15:42
Display list item inline block fix for IE
li {
display: inline-block;
zoom: 1; // hasLayout bug fix for IE
*display: inline; // asterisk (*) in front of display: inline allows for other browsers to ignore that line
}
@GregWallace
GregWallace / styles.css
Created October 15, 2014 14:57
CSS Transparency Settings for All Browsers
/* http://css-tricks.com/css-transparency-settings-for-all-broswers/ */
.transparent { /* change to whatever you are using */
zoom: 1;
filter: alpha(opacity=50);
opacity: 0.5;
}
@GregWallace
GregWallace / soliloquy-filter-youtube-paramters.php
Created July 21, 2014 12:01
Remove controls from YouTube videos in Soliloquy.
<?php
add_filter( 'soliloquy_youtube_args', 'tgm_soliloquy_youtube_args' );
function tgm_soliloquy_youtube_args( $args ) {
/* each of the args can be added/removed to suit */
/* see for paramters: https://developers.google.com/youtube/player_parameters */
$args['rel'] = 0;
$args['controls'] = 0;
$args['color'] = 'white';
$args['autohide'] = 1;
@GregWallace
GregWallace / acf-youtube-embed-link.php
Created April 13, 2014 10:41
This works with ACF when wanting to display a Youtube video.
@GregWallace
GregWallace / fix-blog-menu-item-custom-post-type.php
Created April 12, 2014 13:50
Fix the blog menu item being selected when viewing a custom post type in WordPress
// As of WP 3.1.1 addition of classes for css styling to parents of custom post types doesn't exist.
// We want the correct classes added to the correct custom post type parent in the wp-nav-menu for css styling and highlighting, so we're modifying each individually...
// The id of each link is required for each one you want to modify
// Place this in your WordPress functions.php file
// Reference: http://wordpress.org/support/topic/why-does-blog-become-current_page_parent-with-custom-post-type
function remove_parent_classes($class)
{
// check for current page classes, return false if they exist.
return ($class == 'current_page_item' || $class == 'current_page_parent' || $class == 'current_page_ancestor' || $class == 'current-menu-item') ? FALSE : TRUE;
@GregWallace
GregWallace / retina-image-example.css
Created April 9, 2014 13:19
Retina CSS example. Setting ackground size ensures 2x will scale to fit original image
// reference url: http://stackoverflow.com/questions/16154494/retina-displays-high-res-background-images
@media only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and ( min-device-pixel-ratio: 2),
only screen and ( min-resolution: 192dpi),
only screen and ( min-resolution: 2dppx) {
.box{
background:url('images/box-bg@2x.png') no-repeat top left;
@GregWallace
GregWallace / hide-acf-menu-clients.php
Last active August 29, 2015 13:58
Hide ACF menu from admin
<?php
/**
* Hide ACF menu item from the admin menu
*** Reference url: http://www.advancedcustomfields.com/resources/how-to/how-to-hide-acf-menu-from-clients/
*/
function remove_acf_menu()
{