Home Site news Fixed chapter + page selection in the navigation bar

Fixed chapter + page selection in the navigation bar

by BlushyFace
There was an issue to keep the selection selected in the navigation bar when selecting a chapter + page but it should be fixed now thanks to Boothin.

In comic-easel/widgets/archive-dropdown.php add

        $the_terms = get_the_terms( $post->ID, 'chapters');
        $term = array_shift( $the_terms );

to the else statement in the function ceo_comic_archive_jump_to_chapter

before the array of args

then add

 'selected'             => $term->slug, 

to the args array

In comic-easel/widgets/comiclist-dropdown.php change

 if (!empty($permalink)) $output .='<option class="level-0" value="'.esc_url($permalink).'">'.$qpost->post_title.'</option>'; 

to

 if ($post->post_title == $qpost->post_title) $output .='<option class="level-0" value="'.esc_url($permalink).'" selected>'.$qpost->post_title.'</option>'; //add this
            else if (!empty($permalink)) $output .='<option class="level-0" value="'.esc_url($permalink).'">'.$qpost->post_title.'</option>'; 
in the function ceo_list_jump_to_comic(..)
To change chapter selection order
function ceo_list_jump_to_comic($exclude = ”, $return = false) {
‘order’ => ‘ASC’,
to
‘order’ => ‘DESC’,

Skip to toolbar