Skip to content

Instantly share code, notes, and snippets.

<?php
add_filter('upload_mimes','external_mimes');
function external_mimes($mimes){
return array_merge($mimes,array (
'rar'=> 'application/x-rar-compressed', // you can add more?
));
}
<?php
/**
* Content heading auto ID
*
* Examples;
* <h*>Test Header</h*>
* <h* id="test-header">Test Header</h*>
*/
/*
* For a clean bxSlider!
*/
.bx-wrapper .bx-viewport {
background : none;
border : 0px;
left : 0px;
-moz-box-shadow : none;
-webkit-box-shadow : none;
<?php
/**
* SelectBox box menu walker
* @author : takien, tarikcayir
* @link : http://takien.com
* @version : 1.1
*
* use this on args:
* 'walker' => new SelectBox_Menu_Walker,
* 'items_wrap' => '<select id="%1$s" class="%2$s">%3$s</select>',
<?php
/**
* Change image tag
*/
add_filter( 'image_send_to_editor', 'html5_insert_image', 10, 9 );
function html5_insert_image($html, $id, $caption, $title, $align, $url, $size, $alt) {
<?php
add_filter('the_content', 'remove_p_tags', 20, 1);
function remove_p_tags($content){
$content = force_balance_tags($content);
return preg_replace('#<p>\s*+(<br\s*/*>)?\s*</p>#i', '', $content);
}
/**
* Controls hover fade effect!
*
* Change class name -> slider_class_name
*/
.bx-controls-direction {
opacity: 0;
transition: opacity .25s ease-in-out;
-moz-transition: opacity .25s ease-in-out;
<?php
/*
* WP 3.8 Add CPT Admin icon
*/
add_action( 'admin_head', 'cpt_admin_icon' );
function cpt_admin_icon(){
echo '
<style>
#adminmenu #menu-posts-project div.wp-menu-image:before { content: "\f100"; }
<?php
/*
* Load jQuery FancyBox Modal!
*/
add_action('wp_enqueue_scripts', 'fancbox_scripts');
function fancbox_scripts() {
wp_enqueue_style('fancybox-style', get_template_directory_uri().'/fancybox/jquery.fancybox.css', false ,'2.1.5', 'all' );
wp_enqueue_script('fancybox', get_template_directory_uri().'/fancybox/jquery.fancybox.min.js', array('jquery'),'2.1.51', true );