Skip to content

Instantly share code, notes, and snippets.

@Abban
Abban / WP Theme support post thumbnails
Created June 21, 2012 14:39
WP - Theme Support Post Thumbnails
add_theme_support('post-thumbnails');
set_post_thumbnail_size(732, 9999);
add_image_size('slideshow', 800, 9999);
add_image_size('thumb-pic', 115, 90, TRUE);
@Abban
Abban / WordPress Theme Customizer Sample.php
Created June 21, 2012 21:09
WordPress Theme Customizer Sample
<?php
function themename_customize_register($wp_customize){
$wp_customize->add_section('themename_color_scheme', array(
'title' => __('Color Scheme', 'themename'),
'priority' => 120,
));
// =============================
@Abban
Abban / WP - Meta Links List.php
Created June 23, 2012 18:24
WP - Meta links list
@Abban
Abban / hijack-thickbox.js
Created July 16, 2012 13:18
WP: Hijack Thickbox
$('.add-file').live('click', function(){
formfield = $('#' + $(this).attr('id') + '_field');
// show the thickbox
tb_show( $(this).val() , fab_admin_url + 'media-upload.php?post_id=' + fab_post_id + '&type=file&acf_type=file&TB_iframe=1');
return false;
});
@Abban
Abban / custom-fields.css
Created July 26, 2012 13:14
WP: Custom Metabox Code
#fabfolio_options .inside{
margin:0;
}
#fabfolio_options .inside >div p{
margin: 0 -10px;
padding: 10px 10px 20px;
border-bottom: 1px solid #ccc;
border-top: 1px solid #fff;
}
#fabfolio_options .inside >div p:last-child{
@Abban
Abban / Icon font less mixin
Created October 2, 2012 10:09
CSS: Icon Font Mixin
// Mixin
.icon(@char){
font-family: 'Pictos Custom';
content: @char;
-webkit-font-smoothing: antialiased;
text-transform:none;
font-size: 1.5em;
vertical-align:middle;
font-weight: normal;
@Abban
Abban / Windows-Mobile-Sucks.php
Created October 22, 2012 16:28
PHP function to check if the current user agent is IEMobile/9.0 device
/**
* Is Windows Mobile
*
* Check to see if the user agent is a Windows Mobile
*
* @return boolean
*/
function is_windows_mobile(){
return strstr($_SERVER['HTTP_USER_AGENT'], 'IEMobile/9.0');
@Abban
Abban / is-old-android.php
Created October 23, 2012 16:09
PHP Function to check Android version from the user agent.
/**
* Is Old Android
*
* Check to see it the user agent is Android and if so then
* check the version number to see if it is lower than 4.0.0
* or passed parameter
*
* @param string $version
* @return boolean
*/
@Abban
Abban / Box-Sizing.js
Created January 9, 2013 15:30
Adds Modernizr test for boxsizing then a jQuery element width edit for browsers that don't support it.
/**
* Add Modernizr test for box sizing
*/
Modernizr.addTest("boxsizing", function(){
return Modernizr.testAllProps("boxSizing") && (document.documentMode === undefined || document.documentMode > 7);
});
/**
* Change the width of all elements to account for border-box
*/
@Abban
Abban / get_mail.php
Last active February 26, 2022 15:50
Library for importing from IMAP and parsing the message.
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Get Mail
*
* IMAP library for CodeIgniter. Requires Datamapper (http://datamapper.wanwizard.eu/)
*
* @package Get Mail
* @author Web Together (http://webtogether.ie)
* @version 0.9