Skip to content

Instantly share code, notes, and snippets.

@habibmac
habibmac / Japanese style
Created June 22, 2011 19:41 — forked from endolith/Has weird right-to-left characters.txt
Unicode smileys emoticons
⨀_⨀
⨂_⨂
(/◔ ◡ ◔)/
°ﺑ°
(¬_¬)
(´・ω・`)
(ʘ_ʘ)
(ʘ‿ʘ)
(๏̯͡๏ )
(◕_◕)
@habibmac
habibmac / learning_resources.txt
Created June 6, 2012 10:25 — forked from nathansmith/web-design-development-learning-resources.md
Resources for learning web design & front-end development
Resources for learning web design & front-end development:
================================================================================
**ONLINE**
Design
> http://52weeksofux.com
> http://thedesigncubicle.com
@habibmac
habibmac / gist:2881180
Created June 6, 2012 10:26
CSS: Image Replacement
.ir {
border:0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@habibmac
habibmac / gist:2881181
Created June 6, 2012 10:27
HTML: Starting Template
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title></title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container"></div>
@habibmac
habibmac / gist:2882582
Created June 6, 2012 15:23
WP: Remove update notification for all users except ADMIN user
// REMOVE THE WORDPRESS UPDATE NOTIFICATION FOR ALL USERS EXCEPT SYSADMIN
// This code will ensures that no users other than "admin" are notified by wordpress when updates are available..
global $user_login;
get_currentuserinfo();
if ($user_login !== "admin") { // change admin to the username that gets the updates
add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_version_check' );" ), 2 );
add_filter( 'pre_option_update_core', create_function( '$a', "return null;" ) );
}
// Changed version to only show update notification for admin users (as opposed to just the user 'admin'):
@habibmac
habibmac / gist:2882625
Created June 6, 2012 15:26
WP: Enable hidden admin feature displaying ALL site settings
// CUSTOM ADMIN MENU LINK FOR ALL SETTINGS
// This little piece of code does something pretty cool. It will add an additional option to your settings menu with a link to "all settings" which will show you a complete list of all the settings you have within your database related to your wordpress site. The code below will only made this link visible to an admin user and hide it for all other users.
function all_settings_link() {
add_options_page(__('All Settings'), __('All Settings'), 'administrator', 'options.php');
}
add_action('admin_menu', 'all_settings_link');
@habibmac
habibmac / gist:2882639
Created June 6, 2012 15:28
WP: Modify the login logo & image URL link
// This code will allow you to easily modify the WordPress Login page Logo as well as the href link and title text of this logo.
add_filter( 'login_headerurl', 'namespace_login_headerurl' );
/**
* Replaces the login header logo URL
*
* @param $url
*/
function namespace_login_headerurl( $url ) {
$url = home_url( '/' );
@habibmac
habibmac / untitled.php
Created June 6, 2012 15:47
WP: Include custom post types in the search results
// MAKE CUSTOM POST TYPES SEARCHABLE
function searchAll( $query ) {
if ( $query->is_search ) { $query->set( 'post_type', array( 'site', 'plugin', 'theme', 'person' ) ); }
return $query;
}
add_filter( 'the_search_query', 'searchAll' );
// ADD CUSTOM POST TYPES TO THE DEFAULT RSS FEED
// Add your custom post types to your sites main RSS feed by default.
function custom_feed_request( $vars ) {
@habibmac
habibmac / gist:2883013
Created June 6, 2012 16:19
WP: Loading jQuery from the Google CDN
// even more smart jquery inclusion :)
add_action( 'init', 'jquery_register' );
// register from google and for footer
function jquery_register() {
if ( !is_admin() ) {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', ( 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js' ), false, null, true );
@habibmac
habibmac / gist:2883028
Created June 6, 2012 16:21
WP: Remove the WordPress Version Info for Security
// remove version info from head and feeds
function complete_version_removal() {
return '';
}
add_filter('the_generator', 'complete_version_removal');