',
) );
}
add_action( 'init', 'rita_widgets_init' );
// toolbox's date formatting is too verbose for my taste
function toolbox_posted_on() {
printf( '',
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
);
}
// extending toolbox's nav function to add a link
// up to the chapter a comic is in
function toolbox_content_nav( $nav_id ) {
global $wp_query;
?>
comment_type ) :
case 'pingback' :
case 'trackback' :
?>
set('order', $archive_display_order);
$query->set('posts_per_page', -1);
}
}
// fuck around with the blogroll so we can have it be a popup menu on touch
function widget_links_args_filter($args) {
$args['title_before'] = '';
$args['title_after'] = '';
return $args;
}
add_filter('widget_links_args','widget_links_args_filter');
// we can do featured images!
add_theme_support ('post-thumbnails');
function rita_add_scripts() {
if (is_tax('chapters') || true) {
wp_enqueue_script(
'smoothscroll',
get_stylesheet_directory_uri() . '/js/jquery.smooth-scroll-min.js',
array( 'jquery' ),
'',
true
);
// trying out a click-to-drag as an alternative way to appease scrollwheel fetishists
// just routing scroll up/down to l/r makes scrolling suck for touchpad scrollers like me
// seriously I don't see why just grabbing the scroll bar makes them hate my site instantly
// but whatever, I haven't used a mouse in like ten years so what do I know.
//
// nah, it really just Didn't Work. Fuck those folks.
// wp_enqueue_script(
// 'dragscroll',
// get_stylesheet_directory_uri() . '/js/dragscroll.js',
// '',
// '',
// true
// );
// turns out having the size-page-to-screen script
// makes more complaints than it solves
// wp_enqueue_script(
// 'pagescale',
// get_stylesheet_directory_uri() . '/js/jquery.viewport-min.js',
// array( 'jquery' ),
// '',
// true
// );
}
}
add_action( 'wp_enqueue_scripts', 'rita_add_scripts', 1 );
function rita_chapter_link () {
global $post;
$theterms = get_the_terms( $post->ID, 'chapters');
if (is_array($theterms)) {
$the_term = reset($theterms);
if (is_object($the_term)) {
$term_link = get_term_link($the_term);
$term_name = $the_term->name;
echo "Return to chapter $term_name";
}
}
}
function rita_get_previous_chapter() {
$chapter = ceo_get_adjacent_chapter(true);
if (is_object($chapter)) {
return get_term_link($chapter);
}
return false;
}
function rita_get_prev_chapter() {
return rita_get_previous_chapter();
}
function rita_get_next_chapter() {
$chapter = ceo_get_adjacent_chapter(false);
if (is_object($chapter)) {
return get_term_link($chapter);
}
return false;
}
// Add Theme Customizer functionality.
require get_stylesheet_directory() . '/customizer.php';
// make theme check shut up
add_theme_support( 'automatic-feed-links' );
if (!isset ($content_width)) $content_width = 1024;
// never use the content-single template
// function no_more_single()
// {
// if( is_singular() ) {
// include ( get_template_directory() . '/content.php' );
// }
// }
// add_action( "template_redirect", "no_more_single" ) ;
?>