Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added option to display first comic on the home page

Signed-off-by: Philip M. Hofer (Frumph) <frumph_dragon@yahoo.com>
  • Loading branch information...
commit fc9567da49aad033743571adc3eb7629840912c3 1 parent cdc3403
Philip M. Hofer (Frumph) authored
View
1  changelog.txt
@@ -11,6 +11,7 @@ removed page restraint removal option, better done with CSS via #page, #page-wi
added new option to enable the -foot and -head elements instead of having them always active for those who don't use them
dont display the extra dash if the bloginfo description is empty
started creating a proper readme.txt file
+added option to show first comic on the home page
2.9.2.29.1
$is_comic needed to be set in the archive.php before hand, was giving notice
View
3  comicpress-admin.php
@@ -100,7 +100,8 @@ function comicpress_admin_options() {
'disable_comic_blog_single',
'enable_comments_when_comic_blog_disabled',
'disable_blog_frontpage',
- 'disable_blogheader'
+ 'disable_blogheader',
+ 'display_first_comic_on_home'
) as $key) {
if (!isset($_REQUEST[$key])) $_REQUEST[$key] = 0;
$comicpress_options[$key] = (bool)( $_REQUEST[$key] == 1 ? true : false );
View
3  functions.php
@@ -466,7 +466,8 @@ function comicpress_load_options() {
'archive_comic_width' => '420',
'mini_comic_width' => '198' */
'enable_page_options' => true,
- 'enable_caps' => false
+ 'enable_caps' => false,
+ 'display_first_comic_on_home' => false
) as $field => $value) {
$comicpress_options[$field] = $value;
}
View
5 functions/displaycomic.php
@@ -420,7 +420,10 @@ function comicpress_inject_comic_home() {
global $wp_query;
if (!is_paged() && is_home()) {
if (!comicpress_themeinfo('disable_comic_frontpage')) {
- $wp_query->in_the_loop = true; $comicFrontpage = new WP_Query(); $comicFrontpage->query('showposts=1&cat='.comicpress_all_comic_categories_string());
+ $order = 'DESC';
+ $wp_query->in_the_loop = true; $comicFrontpage = new WP_Query();
+ if (comicpress_themeinfo('display_first_comic_on_home')) $order = 'ASC';
+ $comicFrontpage->query('showposts=1&order='.$order.'&cat='.comicpress_all_comic_categories_string());
while ($comicFrontpage->have_posts()) : $comicFrontpage->the_post();
comicpress_display_comic_area();
endwhile;
View
5 index.php
@@ -1,7 +1,10 @@
<?php
get_header();
if (!comicpress_themeinfo('disable_comic_frontpage') && !comicpress_themeinfo('disable_comic_blog_frontpage') && !is_paged() ) {
- $wp_query->in_the_loop = true; $comicFrontpage = new WP_Query(); $comicFrontpage->query('showposts=1&cat='.comicpress_all_comic_categories_string());
+ $wp_query->in_the_loop = true; $comicFrontpage = new WP_Query();
+ $order = 'DESC';
+ if (comicpress_themeinfo('display_first_comic_on_home')) $order = 'ASC';
+ $comicFrontpage->query('showposts=1&order='.$order.'&cat='.comicpress_all_comic_categories_string());
while ($comicFrontpage->have_posts()) : $comicFrontpage->the_post();
comicpress_display_post();
endwhile;
View
9 options/home.php
@@ -75,6 +75,15 @@
<?php _e('When you have the comic blog disabled on single pages, if you have this checkmarked, the comments will still appear.','comicpress'); ?>
</td>
</tr>
+ <tr class="alternate">
+ <th scope="row"><label for="display_first_comic_on_home"><?php _e('Display the first comic on the home page instead of latest?','comicpress'); ?></label></th>
+ <td>
+ <input id="display_first_comic_on_home" name="display_first_comic_on_home" type="checkbox" value="1" <?php checked(true, comicpress_themeinfo('display_first_comic_on_home')); ?> />
+ </td>
+ <td>
+ <?php _e('Enabling this option will make it so that the first comic in the entire series is displayed on the home page.','comicpress'); ?>
+ </td>
+ </tr>
</table>
<table class="widefat">
View
5 widgets/menubar.php
@@ -27,7 +27,10 @@ function comicpress_menubar() {
<?php } ?>
<?php if (comicpress_themeinfo('enable_navigation_in_menubar')) { ?>
<?php if (is_home() && !comicpress_themeinfo('disable_comic_frontpage')) {
- $comicMenubar = new WP_Query(); $comicMenubar->query('showposts=1&cat='.comicpress_all_comic_categories_string());
+ $comicMenubar = new WP_Query();
+ $order = 'DESC';
+ if (comicpress_themeinfo('display_first_comic_on_home')) $order = 'ASC';
+ $comicMenubar->query('showposts=1&order='.$order.'&cat='.comicpress_all_comic_categories_string());
while ($comicMenubar->have_posts()) : $comicMenubar->the_post();
global $wp_query;
$temp_query = $wp_query->is_single;
Please sign in to comment.
Something went wrong with that request. Please try again.