<div class="column" style="margin-left:auto;">
<select class="form-control" id="ebooks-select">
<option class="form-control" id="eb-part" value="/partner-ebooks">Sort by Partner</option>
<option class="form-control" id="eb-cat" value="/ebooks">Sort by Category</option>
<option class="form-control" id="eb-cat" value="/category/ebooks/downloads">Downloads</option>
</select>
</div>
<script>
$( document ).ready(() => {
$('#ebooks-select').val(window.location.pathname)
});
$('#ebooks-select').on('change', (e)=>{
if(e.target.value != window.location.pathname){
window.location.replace(e.target.value);
}
})
</script>