Skip to content

Commit

Permalink
Added some more options to the showcomic/randcomic shortcode, to sele…
Browse files Browse the repository at this point in the history
…ct year month day and to choose DESC/INC/rand
  • Loading branch information
Frumph committed Mar 1, 2015
1 parent e4b9900 commit 7f6cf37
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 0 additions & 4 deletions css/comiceasel.css
Expand Up @@ -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;
Expand Down
16 changes: 12 additions & 4 deletions functions/shortcodes.php
Expand Up @@ -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 = '';
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7f6cf37

Please sign in to comment.