Compare commits

..

4 Commits

Author SHA1 Message Date
Jacob Haddon
b38064eb69 moved arl_kottke_archives plugin into the archives.php file 2021-07-26 08:53:29 -04:00
Jacob Haddon
16c13dae1d comment functions updated to current 2010, now working 2021-07-26 08:43:56 -04:00
Jacob Haddon
3052a115a1 added in popdown menu with widgets and darkmode styling
Merge branch 'popmenu'
2020-12-21 17:06:16 -05:00
Jacob Haddon
343c961552 removed top border from comments section. 2020-11-19 20:18:11 -05:00
2 changed files with 147 additions and 51 deletions

View File

@ -29,4 +29,72 @@ get_header(); ?>
<?php endwhile; // end of the loop. ?>
<?php get_footer(); ?>
<?php get_footer();
function arl_kottke_archives($month_separator = ' ', $month_format = 'M')
{
/*
This function was originally a plugin, GPL2, information below:
Plugin Name: Kottke Style Archive
Version: 0.3
Plugin URI: http://www.lattimore.id.au/projects/wordpress/plugins/kottke-style-archives/
Author: Alistair Lattimore
Author URI: http://www.lattimore.id.au
Description: Displays an archive of posts in the same style to http://www.kottke.org/everfresh.
*/
global $wpdb;
$output = "";
$year = "";
$sql = "SELECT DATE_FORMAT(post_date, '%Y') AS Year, ";
$sql .= "DATE_FORMAT(post_date, '%m') AS Month ";
$sql .= "FROM $wpdb->posts ";
$sql .= "WHERE DATE_FORMAT(post_date, '%Y') <> '0000'";
$sql .= " AND post_status = 'publish'";
$sql .= " AND post_type = 'post' ";
$sql .= "GROUP BY DATE_FORMAT(post_date, '%Y'), DATE_FORMAT(post_date, '%m') ";
$sql .= "ORDER BY DATE_FORMAT(post_date, '%Y') DESC, DATE_FORMAT(post_date, '%m') ASC;";
$months = $wpdb->get_results($sql);
if (!empty($months))
{
foreach ($months as $month)
{
// Add in the year heading
if (($year == "") || ($year != $month->Year))
{
if (strlen($output))
{
$output .= "<br />\n<strong>" . $month->Year . ":</strong>&nbsp;";
}
else
{
$output .= "\n<strong>" . $month->Year . ":</strong>&nbsp;";
}
}
// Add in the monthly archive links
if ($year == $month->Year)
$output .= $month_separator;
$output .= '<a href="' . get_month_link($month->Year, $month->Month) . '">' . date($month_format, mktime(0, 0, 0, $month->Month, 1, $month->Year)) . '</a>';
$year = $month->Year;
}
}
else
{
$output = "<p>None available</p>\n";
}
print $output;
}
?>

View File

@ -12,11 +12,6 @@ function melville_theme_styles(){
}
add_action( 'wp_enqueue_scripts', 'melville_theme_styles' );
//include 'plugins/drop-caps/wp_drop_caps.php';
if (!function_exists('arl_kottke_archives')) {
include 'plugins/arl_kottke_archives.php';
}
/**
* Set the content width based on the theme's design and stylesheet.
*
@ -156,59 +151,92 @@ function melville_remove_gallery_css( $css ) {
add_filter( 'gallery_style', 'melville_remove_gallery_css' );
if ( ! function_exists( 'melville_comment' ) ) :
/**
* Template for comments and pingbacks.
*
* To override this walker in a child theme without modifying the comments template
* simply create your own twentyten_comment(), and that function will be used instead.
*
* Used as a callback by wp_list_comments() for displaying the comments.
*
* @since Twenty Ten 1.0
*/
function melville_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case '' :
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
/**
* Template for comments and pingbacks.
*
* To override this walker in a child theme without modifying the comments template
* simply create your own twentyten_comment(), and that function will be used instead.
*
* Used as a callback by wp_list_comments() for displaying the comments.
*
* @since Twenty Ten 1.0
*
* @param WP_Comment $comment The comment object.
* @param array $args An array of arguments. @see get_comment_reply_link()
* @param int $depth The depth of the comment.
*/
function melville_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case '':
case 'comment':
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
<div id="comment-<?php comment_ID(); ?>">
<div class="comment-author vcard">
<?php echo get_avatar( $comment, 40 ); ?>
<?php printf( __( '%s <span class="says">said:</span>', 'twentyten' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) ); ?>
</div><!-- .comment-author .vcard -->
<?php if ( $comment->comment_approved == '0' ) : ?>
<em><?php _e( 'Your comment is awaiting moderation.', 'twentyten' ); ?></em>
<div class="comment-author vcard">
<?php echo get_avatar( $comment, 40 ); ?>
<?php
/* translators: %s: Author display name. */
printf( __( '%s <span class="says">says:</span>', 'twentyten' ), sprintf( '<cite class="fn">%s</cite>', get_comment_author_link() ) );
?>
</div><!-- .comment-author .vcard -->
<?php
$commenter = wp_get_current_commenter();
if ( $commenter['comment_author_email'] ) {
$moderation_note = __( 'Your comment is awaiting moderation.', 'twentyten' );
} else {
$moderation_note = __( 'Your comment is awaiting moderation. This is a preview; your comment will be visible after it has been approved.', 'twentyten' );
}
?>
<?php if ( '0' == $comment->comment_approved ) : ?>
<em class="comment-awaiting-moderation"><?php echo $moderation_note; ?></em>
<br />
<?php endif; ?>
<?php endif; ?>
<div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
<?php
/* translators: 1: date, 2: time */
printf( __( '%1$s', 'twentyten' ), get_comment_date(), get_comment_time() ); ?></a><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' );
?>
</div><!-- .comment-meta .commentmetadata -->
<div class="comment-meta commentmetadata"><a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
<?php
/* translators: 1: Date, 2: Time. */
printf( __( '%1$s at %2$s', 'twentyten' ), get_comment_date(), get_comment_time() );
?>
</a>
<?php
edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' );
?>
</div><!-- .comment-meta .commentmetadata -->
<div class="comment-body"><?php comment_text(); ?></div>
<div class="comment-body"><?php comment_text(); ?></div>
<div class="reply">
<?php comment_reply_link( array_merge( $args, array( 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
</div><!-- .reply -->
</div><!-- #comment-## -->
<div class="reply">
<?php
comment_reply_link(
array_merge(
$args,
array(
'depth' => $depth,
'max_depth' => $args['max_depth'],
)
)
);
?>
</div><!-- .reply -->
</div><!-- #comment-## -->
<?php
break;
case 'pingback' :
case 'trackback' :
?>
<li class="post pingback">
<p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __('(Edit)', 'twentyten'), ' ' ); ?></p>
<?php
break;
endswitch;
}
<?php
break;
case 'pingback':
case 'trackback':
?>
<li class="post pingback">
<p><?php _e( 'Pingback:', 'twentyten' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( '(Edit)', 'twentyten' ), ' ' ); ?></p>
<?php
break;
endswitch;
}
endif;
/**
* Removes the default styles that are packaged with the Recent Comments widget.
*