Last active
April 2, 2018 22:17
-
-
Save pajtai/a25ac40a76e2c3caf657347a66cd4408 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$pagination = paginate_links( array( | |
'base' => get_pretty_url($currentMarket, $currentCategory) . '%_%', | |
'format' => '/page/%#%', | |
'current' => $paged, | |
'total' => $posts->pagination()->total, | |
'prev_next' => false | |
)); | |
function get_pretty_url( $root, $marketSlug, $topicSlug ) { | |
$pretty_url = '/' . get_query_var('pagename'); | |
if ( $marketSlug ) { | |
$pretty_url .= "/market/$marketSlug"; | |
} | |
if ( $topicSlug ) { | |
$pretty_url .= "/category/$topicSlug"; | |
} | |
return $pretty_url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment