__( 'Primary Navigation', 'twentyten' ),
) );
// This theme allows users to set a custom background
add_custom_background();
}
endif;
?>
' . __( 'Continue reading →', 'twentyten' ) . '';
}
/**
* Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and thinkbox_continue_reading_link().
* @return string An ellipsis
*/
function thinkbox_auto_excerpt_more( $more ) {
return ' …' . thinkbox_continue_reading_link();
}
add_filter( 'excerpt_more', 'thinkbox_auto_excerpt_more' );
/**
* Adds a pretty "Continue Reading" link to custom post excerpts.
* @return string Excerpt with a pretty "Continue Reading" link
*/
function thinkbox_custom_excerpt_more( $output ) {
if ( has_excerpt() && ! is_attachment() ) {
$output .= thinkbox_continue_reading_link();
}
return $output;
}
add_filter( 'get_the_excerpt', 'thinkbox_custom_excerpt_more' );
/**
* Remove inline styles printed when the gallery shortcode is used.
* @return string The gallery style filter, with the styles themselves removed.
*/
function thinkbox_remove_gallery_css( $css ) {
return preg_replace( "##s", '', $css );
}
add_filter( 'gallery_style', 'thinkbox_remove_gallery_css' );
if ( ! function_exists( 'thinkbox_comment' ) ) :
/**
* Template for comments and pingbacks.
*/
function thinkbox_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case '' :
?>
id="li-comment-">
__( 'Primary Widget Area', 'twentyten' ),
'id' => 'primary-widget-area',
'description' => __( 'The primary widget area', 'twentyten' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
) );
// Area 2, located below the Primary Widget Area in the sidebar. Empty by default.
register_sidebar( array(
'name' => __( 'Secondary Widget Area', 'twentyten' ),
'id' => 'secondary-widget-area',
'description' => __( 'The secondary widget area', 'twentyten' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
) );
}
/** Register sidebars by running thinkbox_widgets_init() on the widgets_init hook. */
add_action( 'widgets_init', 'thinkbox_widgets_init' );
/**
* Removes the default styles that are packaged with the Recent Comments widget.
*
* To override this in a child theme, remove the filter and optionally add your own
* function tied to the widgets_init action hook.
*
* @since Twenty Ten 1.0
*/
function thinkbox_remove_recent_comments_style() {
global $wp_widget_factory;
remove_action( 'wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) );
}
add_action( 'widgets_init', 'thinkbox_remove_recent_comments_style' );
if ( ! function_exists( 'thinkbox_posted_in' ) ) :
/**
* Prints HTML with meta information for the current post (category, tags and permalink).
*
* @since Twenty Ten 1.0
*/
function thinkbox_posted_in() {
// Retrieves tag list of current post, separated by commas.
$tag_list = get_the_tag_list( '', ', ' );
if ( $tag_list ) {
$posted_in = __( 'Posted in %1$s . Tagged %2$s. Bookmark the permalink.', 'twentyten' );
} elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) {
$posted_in = __( 'Posted in %1$s. Bookmark the permalink.', 'twentyten' );
} else {
$posted_in = __( 'Bookmark the permalink.', 'twentyten' );
}
// Prints the string, replacing the placeholders.
printf(
$posted_in,
get_the_category_list( ', ' ),
$tag_list,
get_permalink(),
the_title_attribute( 'echo=0' )
);
}
endif;
/* ThinkBox Options */
class thinkboxOptions {
function getOptions() {
$options = get_option('thinkbox_options');
if (!is_array($options)) {
$options['rss_url'] = '';
$options['twitter_url'] = '';
$options['facebook_url'] = '';
$options['analytics']='';
update_option('thinkbox_options', $options);
}
return $options;
}
function init() {
if(isset($_POST['classic_save'])) {
$options = thinkboxOptions::getOptions();
$options['rss_url'] = stripslashes($_POST['rss_url']);
$options['twitter_url'] = stripslashes($_POST['twitter_url']);
$options['facebook_url'] = stripslashes($_POST['facebook_url']);
$options['analytics'] = stripslashes($_POST['analytics']);
update_option('thinkbox_options', $options);
} else {
thinkboxOptions::getOptions();
}
add_theme_page("Thinkbox Options", "Thinkbox Options", 'edit_themes', basename(__FILE__), array('thinkboxOptions', 'display'));
}
function display() {
$options = thinkboxOptions::getOptions();
?>