This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Useful Shortcodes | |
add_shortcode('home_url', 'return_home_url'); | |
add_filter('widget_text', 'do_shortcode'); // enable shortcodes on widgets | |
function return_home_url() { | |
return home_url(); | |
} | |
add_shortcode('theme_url', 'return_theme_url'); | |
function return_theme_url() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Clear Form on Focus | |
$('#search input[type="text"]').each(function() { | |
var default_value = this.value; | |
$(this).focus(function() { | |
if(this.value == default_value) { | |
this.value = ''; | |
} | |
}); | |
$(this).blur(function() { | |
if(this.value == '') { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Useful Shortcodes | |
add_shortcode('home_url', 'return_home_url'); | |
add_filter('widget_text', 'do_shortcode'); // enable shortcodes on widgets | |
function return_home_url() { | |
return home_url(); | |
} | |
add_shortcode('theme_url', 'return_theme_url'); | |
function return_theme_url() { | |
return get_bloginfo('template_url'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Register Sidebar | |
if ( function_exists('register_sidebar') ) { | |
register_sidebar(array( | |
'before_widget' => '<div class="widget"', | |
'after_widget' => '</div>', | |
'before_title' => '<h4 class="widget-title">', | |
'after_title' => '</h4>', | |
'name' =>'General Sidebar' | |
'id' =>'general-sidebar' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add custom post type | |
add_action( 'init', 'create_custom_post_type' ); | |
function create_custom_post_type() { | |
register_post_type( 'custom_post', | |
array( | |
'labels' => array( | |
'name' => __( 'Custom Posts' ), | |
'singular_name' => __( 'Custom Post' ) | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Modify Logo URL | |
add_filter( 'login_headerurl', 'login_page_url'); | |
function login_page_url(){ | |
return home_url(); | |
} | |
// Modify Login Title | |
add_filter( 'login_headertitle', 'login_page_title'); | |
function login_page_title(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enqueue Styles and Scripts | |
add_action('wp_enqueue_scripts', 'load_styles_and_scripts'); | |
function load_styles_and_scripts() | |
{ | |
wp_enqueue_style( 'style', get_bloginfo('template_directory') . '/css/theme.css' ); | |
wp_enqueue_script( 'script', get_bloginfo('template_directory') . '/js/script.css', 'jquery', '1.7', false ); | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function ($) { | |
$('.gallery .gallery-item a').attr('rel', 'fancybox').fancybox(); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// remove default gallery styles | |
add_filter('gallery_style', create_function('$a', 'return "<div class=\'gallery\'>";')); | |
?> |
OlderNewer