updated all the function names from twentyten_ to melville_

This commit is contained in:
Jacob Haddon 2020-03-27 16:27:21 -04:00
parent c03acb52aa
commit 426f325bcf
3 changed files with 44 additions and 41 deletions

View File

@ -24,10 +24,10 @@ include 'plugins/arl_kottke_archives.php';
if ( ! isset( $content_width ) )
$content_width = 640;
/** Tell WordPress to run twentyten_setup() when the 'after_setup_theme' hook is run. */
add_action( 'after_setup_theme', 'twentyten_setup' );
/** Tell WordPress to run melville_setup() when the 'after_setup_theme' hook is run. */
add_action( 'after_setup_theme', 'melville_setup' );
if ( ! function_exists( 'twentyten_setup' ) ):
if ( ! function_exists( 'melville_setup' ) ):
/**
* Sets up theme defaults and registers support for various WordPress features.
*
@ -49,7 +49,7 @@ if ( ! function_exists( 'twentyten_setup' ) ):
*
* @since Twenty Ten 1.0
*/
function twentyten_setup() {
function melville_setup() {
// This theme uses post thumbnails
add_theme_support( 'post-thumbnails' );
@ -77,11 +77,11 @@ endif;
*
* @since Twenty Ten 1.0
*/
function twentyten_page_menu_args( $args ) {
function melville_page_menu_args( $args ) {
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'twentyten_page_menu_args' );
add_filter( 'wp_page_menu_args', 'melville_page_menu_args' );
/**
* Sets the post excerpt length to 40 characters.
@ -92,10 +92,10 @@ add_filter( 'wp_page_menu_args', 'twentyten_page_menu_args' );
* @since Twenty Ten 1.0
* @return int
*/
function twentyten_excerpt_length( $length ) {
function melville_excerpt_length( $length ) {
return 40;
}
add_filter( 'excerpt_length', 'twentyten_excerpt_length' );
add_filter( 'excerpt_length', 'melville_excerpt_length' );
/**
* Returns a "Continue Reading" link for excerpts
@ -103,7 +103,7 @@ add_filter( 'excerpt_length', 'twentyten_excerpt_length' );
* @since Twenty Ten 1.0
* @return string "Continue Reading" link
*/
function twentyten_continue_reading_link() {
function melville_continue_reading_link() {
return ' <a href="'. get_permalink() . '">' . __( 'continue reading', 'twentyten' ) . '</a>';
}
@ -116,10 +116,10 @@ function twentyten_continue_reading_link() {
* @since Twenty Ten 1.0
* @return string An ellipsis
*/
function twentyten_auto_excerpt_more( $more ) {
return '&hellip; ' . twentyten_continue_reading_link() . ' &raquo;';
function melville_auto_excerpt_more( $more ) {
return '&hellip; ' . melville_continue_reading_link() . ' &raquo;';
}
add_filter( 'excerpt_more', 'twentyten_auto_excerpt_more' );
add_filter( 'excerpt_more', 'melville_auto_excerpt_more' );
/**
* Adds a pretty "Continue Reading" link to custom post excerpts.
@ -130,13 +130,13 @@ add_filter( 'excerpt_more', 'twentyten_auto_excerpt_more' );
* @since Twenty Ten 1.0
* @return string Excerpt with a pretty "Continue Reading" link
*/
function twentyten_custom_excerpt_more( $output ) {
function melville_custom_excerpt_more( $output ) {
if ( has_excerpt() && ! is_attachment() ) {
$output .= twentyten_continue_reading_link();
$output .= melville_continue_reading_link();
}
return $output;
}
add_filter( 'get_the_excerpt', 'twentyten_custom_excerpt_more' );
add_filter( 'get_the_excerpt', 'melville_custom_excerpt_more' );
/**
* Remove inline styles printed when the gallery shortcode is used.
@ -146,12 +146,12 @@ add_filter( 'get_the_excerpt', 'twentyten_custom_excerpt_more' );
* @since Twenty Ten 1.0
* @return string The gallery style filter, with the styles themselves removed.
*/
function twentyten_remove_gallery_css( $css ) {
function melville_remove_gallery_css( $css ) {
return preg_replace( "#<style type='text/css'>(.*?)</style>#s", '', $css );
}
add_filter( 'gallery_style', 'twentyten_remove_gallery_css' );
add_filter( 'gallery_style', 'melville_remove_gallery_css' );
if ( ! function_exists( 'twentyten_comment' ) ) :
if ( ! function_exists( 'melville_comment' ) ) :
/**
* Template for comments and pingbacks.
*
@ -162,7 +162,7 @@ if ( ! function_exists( 'twentyten_comment' ) ) :
*
* @since Twenty Ten 1.0
*/
function twentyten_comment( $comment, $args, $depth ) {
function melville_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case '' :
@ -213,19 +213,19 @@ endif;
*
* @since Twenty Ten 1.0
*/
function twentyten_remove_recent_comments_style() {
function melville_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', 'twentyten_remove_recent_comments_style' );
add_action( 'widgets_init', 'melville_remove_recent_comments_style' );
if ( ! function_exists( 'twentyten_posted_on' ) ) :
if ( ! function_exists( 'melville_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post--date/time and author.
*
* @since Twenty Ten 1.0
*/
function twentyten_posted_on() {
function melville_posted_on() {
printf( __( '%2$s', 'twentyten' ),
'meta-prep meta-prep-author',
sprintf( '%3$s',
@ -237,13 +237,13 @@ function twentyten_posted_on() {
}
endif;
if ( ! function_exists( 'twentyten_posted_in' ) ) :
if ( ! function_exists( 'melville_posted_in' ) ) :
/**
* Prints HTML with meta information for the current post (category, tags and permalink).
*
* @since Twenty Ten 1.0
*/
function twentyten_posted_in() {
function melville_posted_in() {
// Retrieves tag list of current post, separated by commas.
$tag_list = get_the_tag_list( '', ', ' );
if ( $tag_list ) {
@ -265,10 +265,10 @@ function twentyten_posted_in() {
endif;
// dropcaps
function theme_shortcode_dropcaps($atts, $content = null, $code) {
function melville_shortcode_dropcaps($atts, $content = null, $code) {
return '<span class="dropcap">' . do_shortcode($content) . '</span>';
}
add_shortcode('dropcap', 'theme_shortcode_dropcaps');
add_shortcode('dropcap', 'melville_shortcode_dropcaps');
//build out our Portfolio Theme options
@ -317,4 +317,7 @@ function melville_theme_options_page() { ?>
<p>Melville theme for WordPress, made by <a href="http://madebyraygun.com">Raygun</a>.
</div>
<?php } ?>
<?php }
?>

View File

@ -45,7 +45,7 @@
<?php if ( in_category( _x('gallery', 'gallery category slug', 'twentyten') ) ) : ?>
<h2><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<?php twentyten_posted_on(); ?>
<?php melville_posted_on(); ?>
<?php if ( post_password_required() ) : ?>
<?php the_content(); ?>
@ -81,7 +81,7 @@
<?php the_content( __( 'continue reading &raquo;', 'twentyten' ) ); ?>
<?php endif; ?>
<?php twentyten_posted_on(); ?>
<?php melville_posted_on(); ?>
|
<?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?>
<?php edit_post_link( __( 'Edit', 'twentyten' ), '| ', '' ); ?>
@ -91,20 +91,20 @@
<?php else : ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<?php if ( is_archive() || is_search() ) : // Display excerpts for archives and search. ?>
<?php the_excerpt(); ?>
<?php else : ?>
<?php the_content( __( 'continue reading &raquo;', 'twentyten' ) ); ?>
<p class="date"><?php twentyten_posted_on(); ?>&nbsp;&nbsp;<?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></p>
<p class="date"><?php melville_posted_on(); ?>&nbsp;&nbsp;<?php comments_popup_link( __( 'Leave a comment', 'twentyten' ), __( '1 Comment', 'twentyten' ), __( '% Comments', 'twentyten' ) ); ?></p>
<?php endif; ?>
</div>
<?php endif; // This was the if statement that broke the loop into three parts based on categories. ?>
@ -114,4 +114,4 @@
<?php if ( $wp_query->max_num_pages > 1 ) : ?>
<span class="older-posts"><?php next_posts_link( __( '&laquo; older posts', 'twentyten' ) ); ?></span>
<span class="newer-posts"><?php previous_posts_link( __( 'newer posts &raquo;', 'twentyten' ) ); ?></span>
<?php endif; ?>
<?php endif; ?>

View File

@ -7,15 +7,15 @@ get_header(); ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
<p class="date"><?php twentyten_posted_on(); ?></p>
<p class="post-meta"><?php twentyten_posted_in();?>
<p class="date"><?php melville_posted_on(); ?></p>
<p class="post-meta"><?php melville_posted_in();?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div>
<?php get_footer(); ?>
<?php get_footer(); ?>