This file contains hidden or 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 | |
/** | |
* Set up Widget Areas (Dynamic Sidebars) | |
*/ | |
register_sidebar( array( | |
'name' => 'Home Features', | |
'description' => 'An area near the bottom of the home page', | |
'id' => 'home-features', | |
'before_widget' => '<div id="%1$s" class="widget %2$s">', | |
'after_widget' => '</div>', |
This file contains hidden or 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 | |
//change the default (55 words) length of excerpts to 20 words | |
function new_ex_length($length) { | |
return 20; | |
} | |
add_filter('excerpt_length', 'new_ex_length', 999); | |
//changes the [...] to a button when excerpt content is truncated | |
function new_excerpt_more($more) { | |
$readmore = 'Read More'; |
This file contains hidden or 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 | |
function awesome_comment_reply(){ | |
if( !is_admin() && is_singular() && comments_open() && get_option('thread_comments') ): | |
wp_enqueue_script( 'comment-reply' ); | |
endif; | |
} | |
add_action( 'wp_print_scripts', 'awesome_comment_reply' ); |
This file contains hidden or 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 | |
//turn on tumblr-style post formats | |
add_theme_support('post-formats', array('image', 'video', 'audio', 'quote', 'gallery')); | |
//adds ability to have one featured image per post or page | |
add_theme_support('post-thumbnails'); | |
//more robust feed links on every page | |
add_theme_support('automatic-feed-links'); |
This file contains hidden or 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 | |
//Configuration | |
$perpage = 5; //number of results to show per page | |
$pagenum = 1; // set the starting page number | |
//what phrase did they search for? | |
$phrase = $_GET['phrase']; | |
//get all posts and comments that are similar to the query, make sure the posts are distinct | |
$query_search = "SELECT distinct * |
This file contains hidden or 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
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, | |
del, dfn, em, img, ins, kbd, q, s, samp, | |
small, strike, strong, sub, sup, tt, var, | |
b, u, i, center, | |
dl, dt, dd, ol, ul, li, | |
fieldset, form, label, legend, | |
table, caption, tbody, tfoot, thead, tr, th, td, |
This file contains hidden or 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
/* | |
Theme Name: Twenty Ten | |
Theme URI: http://wordpress.org/ | |
Description: The 2010 default theme for WordPress. | |
Author: wordpressdotorg | |
Author URI: http://wordpress.org/ | |
Version: 1.0 | |
Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu (optional) | |
License: |
This file contains hidden or 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
/* | |
stylesheet for recent posts plugin with thumbnails | |
*/ | |
.products-widget img { | |
margin:0 0 10px 0; | |
} | |
.products-widget .readmore { | |
display:none; | |
} |
This file contains hidden or 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 | |
function rad_register_widget(){ | |
register_widget('Rad_Simple_Widget'); | |
} | |
add_action('widgets_init', 'rad_register_widget'); | |
//our new widget is a copy of the WP_Widget object class | |
class Rad_Simple_Widget extends WP_Widget{ | |
function __construct(){ |