In the projects page, where all the projects are, there is an option (select option) to sort alphabetically and another to sort chronologically. When going to the detail of each project has a link to the project to follow and another link to the previous one. I wanted to ask if it is possible for the previous and next project to be sorted according to the selected option from the projects page.
Projects page: link
<div class="row filterr">
<div class="filter">
<input type="radio" name="ccc" class="alfabet" id="c1" value="1">
<label for="c1">
<?php
if (get_locale() == 'en_US') { echo " Alphabetical"; } else { echo " Alfabeticamente"; }
?>
</label>
<br>
<input style="margin-top: 12px;" type="radio" name="ccc" id="c2" value="2">
<label for="c2">
<?php
if (get_locale() == 'en_US') { echo " Chronological"; } else { echo " Cronologicamente";} ?>
</label>
<br>
<input style="visibility: hidden;" type="radio" name="ccc" id="c3" value="3" checked="checked">
<label for="c3" style="visibility: hidden;">
<?php
if (get_locale() == 'en_US') { echo " Random"; } else { echo " Aleatoriamente";}
?>
</label>
</div>
</div>
<div class="text">
<div id="primary" class="row projects projects-filter">
<?php
if(substr($_SERVER['REMOTE_ADDR'], 0, 4) == '127.' || $_SERVER['REMOTE_ADDR'] == '::1') {
if (get_locale() == 'en_US') { $project = 47; } else { $project = 49; }
} else {
if (get_locale() == 'en_US') { $project = 69; } else { $project = 71; }
}
$query = new WP_Query( array( 'post_type' => 'post','orderby' => 'rand',
'order' => 'ASC', 'cat' => $project ) );
if ( $query->have_posts() ) :
while ( $query->have_posts() ) : $query->the_post();
get_template_part( 'template-parts/content', get_post_format() );
endwhile;
else :
endif;
?>
</div>
</div>
<div class="text2" style="display: none;">
<div id="primary" class="row projects projects-filter">
<?php
$query = new WP_Query( array( 'post_type' => 'post','orderby' => 'date',
'order' => 'DESC', 'cat' => $project ) );
if ( $query->have_posts() ) :
while ( $query->have_posts() ) : $query->the_post();
get_template_part( 'template-parts/content', get_post_format() );
endwhile;
else :
endif;
?>
</div>
</div>
<div class="text3" style="display: none;">
<div id="primary" class="row projects projects-filter">
<?php
$query = new WP_Query( array( 'post_type' => 'post','orderby' => 'title',
'order' => 'ASC', 'cat' => $project ) );
if ( $query->have_posts() ) :
while ( $query->have_posts() ) : $query->the_post();
get_template_part( 'template-parts/content', get_post_format() );
endwhile;
else :
endif;
?>
</div>
</div>