If you want to sort jobs alphabetically in Job Manager and use sticky sort for highlighted items it will mess up the order of all non-highlighted opportunities. This was my quick workaround. Hopefully it will help someone.
In frontend-jobs.php
<?php
function jobman_sort_highlighted_jobs( $a, $b ) {
$ahighlighted = get_post_meta( $a->ID, 'highlighted', true );
$bhighlighted = get_post_meta( $b->ID, 'highlighted', true );
if( $ahighlighted == $bhighlighted )
return strnatcmp($a->post_title, $b->post_title);
if( 1 == $ahighlighted )
return -1;
if( 1 == $bhighlighted )
return 1;
return strnatcmp($a->post_title, $b->post_title);
}
?>
Write a Comment