Skip to content

Instantly share code, notes, and snippets.

View zigbaird's full-sized avatar

Zig Baird zigbaird

  • zigbaird
  • 75407
  • X @zig
View GitHub Profile
/* Allow PHP in Widgets */
add_filter('widget_text','execute_php',100);
function execute_php($html){
if(strpos($html,"<"."?php")!==false){
ob_start();
eval("?".">".$html);
$html=ob_get_contents();
ob_end_clean();
}
return $html;
/* Home Contact
------------------------------------------------------------ */
#home-contact {
width: 100%;
background-color: #f1f1f1;
border-bottom: 1px solid #bbb;
clear: both;
margin: 0 auto;
overflow: hidden;
@zigbaird
zigbaird / fix-login-redirect.php
Last active December 12, 2015 03:18
Hardcode home and sitename in wp-config so WordPress doesn't redirect back to login screen - quick fix/hack only.
<?php
define('WP_HOME', 'http://sitename.com');
define('WP_SITEURL', 'http://sitename.com');
@zigbaird
zigbaird / comments-on-select-multisites.php
Last active December 12, 2015 01:38
Disables comments on all multisites except specified site IDs
<?php
function comments_and_pings_closed( $open, $post_id ) {
global $blog_id;
$comment_sites = array( 10, 15 ); // Site IDs of site that you don't want automatically disabled
if ( in_array( $blog_id, $comment_sites ) ) {
/* Responsive Video Container */
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
overflow: hidden;
}
<?php
// Add/Remove Contact Methods
function add_remove_contactmethods( $contactmethods ) {
$contactmethods['twitter'] = 'Twitter';
$contactmethods['facebook'] = 'Facebook';
$contactmethods['googleplus'] = 'Google Plus';
$contactmethods['github'] = 'GitHub';
$contactmethods['linkedin'] = 'Linked In';
$contactmethods['flickr'] = 'Flickr';
@zigbaird
zigbaird / wp-query-ref.php
Created October 12, 2012 03:30 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(