From 7f6cf3769be75c18e9d461ff982e5394642170a4 Mon Sep 17 00:00:00 2001 From: Frumph Date: Sun, 1 Mar 2015 07:05:24 -0800 Subject: [PATCH] Added some more options to the showcomic/randcomic shortcode, to select year month day and to choose DESC/INC/rand --- css/comiceasel.css | 4 ---- functions/shortcodes.php | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/css/comiceasel.css b/css/comiceasel.css index 2c4826f..9dedbe6 100644 --- a/css/comiceasel.css +++ b/css/comiceasel.css @@ -94,10 +94,6 @@ table#comic-nav-wrapper { float: left; } -.mininav-prev a:hover, .mininav-next a:hover { - color: #ffcf00; -} - #comic img { margin: 0; padding: 0; diff --git a/functions/shortcodes.php b/functions/shortcodes.php index e43b536..0f71582 100644 --- a/functions/shortcodes.php +++ b/functions/shortcodes.php @@ -6,7 +6,8 @@ add_shortcode('transcript', 'ceo_display_transcript'); add_shortcode('buycomic', 'ceo_display_buycomic'); add_shortcode('comic-archive-dropdown', 'ceo_comic_archive_dropdown'); -add_shortcode('randcomic', 'ceo_random_comic_shortcode'); +add_shortcode('randcomic', 'ceo_random_comic_shortcode'); // old +add_shortcode('showcomic', 'ceo_random_comic_shortcode'); // new function ceo_cast_display($character, $stats, $image) { $cast_output = ''; @@ -623,17 +624,24 @@ function ceo_random_comic_shortcode($atts, $content = '') { 'character' => '', 'size' => 'thumbnail', 'slug' => '', - 'chapter' => '' + 'chapter' => '', + 'orderby' => 'rand', + 'month' => '', + 'day' => '', + 'year' => '' ), $atts ) ); global $post; $args = array( 'name' => $slug, - 'orderby' => 'rand', + 'orderby' => $orderby, 'showposts' => 1, 'post_type' => 'comic', 'chapters' => $chapter, 'characters' => $character, - 'exclude' => $post->ID + 'exclude' => $post->ID, + 'year' => $year, + 'month' => $month, + 'day' => $day ); ceo_protect(); $thumbnail_query = new WP_Query($args);