Skip to content

Commit

Permalink
Support for jetpack's mobile theme - notoggle always on
Browse files Browse the repository at this point in the history
  • Loading branch information
Frumph committed Sep 3, 2015
1 parent d6440a5 commit 8fae15d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions functions/injections.php
Expand Up @@ -12,6 +12,9 @@
add_action('comic-transcript', 'ceo_display_the_transcript_action');
add_action('wp_head', 'ceo_social_meta');

// Jetpack Mobile Theme Addition
add_action('jetpack_mobile_header_after', 'ceo_display_comic_area');
add_action('jetpack_mobile_header_after', 'ceo_display_comic_post_home');

function ceo_version_meta() {
echo apply_filters('ceo_version_meta', '<meta name="Comic-Easel" content="'.ceo_pluginfo('version').'" />'."\r\n");
Expand Down Expand Up @@ -67,7 +70,7 @@ function ceo_display_comic_navigation() {
<td class="comic-nav"><?php if ( get_permalink() != $first_comic ) { ?><a href="<?php echo $first_comic ?>" class="comic-nav-base comic-nav-first<?php if ( get_permalink() == $first_comic ) { ?> comic-nav-inactive<?php } ?>"><?php echo $first_text; ?></a><?php } else { echo '<span class="comic-nav-base comic-nav-first comic-nav-void">'.$first_text.'</span>'; } ?></td>
<td class="comic-nav"><?php if ($prev_comic) { ?><a href="<?php echo $prev_comic ?>" class="comic-nav-base comic-nav-previous<?php if (!$prev_comic) { ?> comic-nav-inactive<?php } ?>"><?php echo $prev_text; ?></a><?php } else { echo '<span class="comic-nav-base comic-nav-previous comic-nav-void ">'.$prev_text.'</span>'; } ?></td>
<?php
if (ceo_pluginfo('enable_buy_comic')) {
if (ceo_pluginfo('enable_buy_comic') && !wp_is_mobile()) {
if (strpos(ceo_pluginfo('buy_comic_url'), '?') !== false) {
$bpsep = '&';
} else {
Expand All @@ -76,11 +79,11 @@ function ceo_display_comic_navigation() {
?>
<td class="comic-nav"><a href="<?php echo ceo_pluginfo('buy_comic_url').$bpsep.'id='.$post->ID; ?>" class="comic-nav-base comic-nav-buycomic" title="Buy Comic"><?php _e('Buy!','comiceasel'); ?></a></td>
<?php }
if (ceo_pluginfo('enable_comment_nav')) {
if (ceo_pluginfo('enable_comment_nav') && !wp_is_mobile()) {
$commentscount = get_comments_number(); ?>
<td class="comic-nav"><a href="<?php comments_link(); ?>" class="comic-nav-comments" title="<?php the_title(); ?>"><span class="comic-nav-comment-count"><?php echo sprintf( _n( 'Comment(%d)', 'Comments(%d)', $commentscount, 'comiceasel' ), $commentscount ); ?></span></a></td>
<?php }
if (ceo_pluginfo('enable_random_nav')) {
if (ceo_pluginfo('enable_random_nav') && !wp_is_mobile()) {
$stay = '';
if (ceo_pluginfo('enable_chapter_only_random')) {
$chapter = get_the_terms($post->ID, 'chapters');
Expand All @@ -98,7 +101,7 @@ function ceo_display_comic_navigation() {
<td class="comic-nav comic-nav-jumptocomic"><?php ceo_list_jump_to_comic(); ?></td>
<?php } ?>
</tr>
<?php if (ceo_pluginfo('enable_embed_nav')) { ?>
<?php if (ceo_pluginfo('enable_embed_nav') && !wp_is_mobile()) { ?>
<tr>
<td class="comic-nav" colspan="15">
<?php
Expand Down Expand Up @@ -218,6 +221,9 @@ function ceo_inject_mini_navigation() {

function ceo_display_comic_post_home() {
global $wp_query, $post;
if (wp_is_mobile()) {
echo '<div style="margin: 10px; background: #fff; padding: 10px;">';
}
if (is_front_page() && !is_paged() && !ceo_pluginfo('disable_comic_blog_on_home_page')) {
$order = (ceo_pluginfo('display_first_comic_on_home_page')) ? 'asc' : 'desc';
$chapter_on_home = '';
Expand All @@ -242,6 +248,7 @@ function ceo_display_comic_post_home() {
comments_template('', true);
}
wp_reset_query();
if (wp_is_mobile()) echo '</div>';

This comment has been minimized.

Copy link
@georgestephanis

georgestephanis Sep 3, 2015

This is nested inside the conditional while the opening is above the conditional. Couldn't this cause problems where it is mobile, but the conditional is false, so the <div> is opened, but never closed?

This comment has been minimized.

Copy link
@Frumph

Frumph Sep 3, 2015

Author Owner

yes, need to remove it from inside and put it on outside where it lines up, good catch .

// visa versa but I got your idea ;/ fixed

echo '<div id="blogheader"></div>';
}
}
Expand Down
2 changes: 1 addition & 1 deletion widgets/archive-dropdown.php
Expand Up @@ -4,7 +4,7 @@
Widget URI: http://comiceasel.org/
Description: Display a list of links of the latest comics.
Author: Philip M. Hofer (Frumph)
Version: 1.02
Version: 1.1
*/

class ceo_walker_taxonomy_dropdown extends Walker_CategoryDropdown {
Expand Down

0 comments on commit 8fae15d

Please sign in to comment.