diff --git a/classes/ComicPressNavigation.inc b/classes/ComicPressNavigation.inc index bc83178..859e92e 100644 --- a/classes/ComicPressNavigation.inc +++ b/classes/ComicPressNavigation.inc @@ -35,6 +35,10 @@ class ComicPressNavigation { foreach ($valid as $field) { $nav["storyline-chapter-${field}"] = $this->_dbi->get_first_comic($this->_storyline->{$field}($category)); } + + if ($post->ID != $nav['storyline-chapter-current']->ID) { + $nav['storyline-chapter-previous'] = $nav['storyline-chapter-current']; + } } } diff --git a/classes/ComicPressStoryline.inc b/classes/ComicPressStoryline.inc index aa8896b..6b782b5 100644 --- a/classes/ComicPressStoryline.inc +++ b/classes/ComicPressStoryline.inc @@ -83,12 +83,13 @@ class ComicPressStoryline { return false; } + function current($id) { return $id; } function parent($id) { return $this->_get_field('parent', $id); } function previous($id) { return $this->_get_field('previous', $id); } function next($id) { return $this->_get_field('next', $id); } function valid($id) { if (isset($this->_structure[$id])) { - return array_keys($this->_structure[$id]); + return array_merge(array_keys($this->_structure[$id]), array('current')); } return false; } diff --git a/widgets/graphical-navigation.php b/widgets/graphical-navigation.php index c4c0468..498fd57 100644 --- a/widgets/graphical-navigation.php +++ b/widgets/graphical-navigation.php @@ -77,7 +77,7 @@ class widget_comicpress_graphical_navigation extends WP_Widget { case 'story_next': case 'next': $link = get_permalink($target->ID); - if (($which == 'next') && ($instance['nextgohome'] == 'on')) { $link = get_bloginfo('url'); } + if (($which == 'last') && ($instance['nextgohome'] == 'on')) { $link = get_bloginfo('url'); } if ($ok) { ?> + case "last": ?>