I'm using this code to get category slug on categories archive page outside of the loop:

<?php $cat = get_term_by('name', single_cat_title('',false), 'category'); echo $cat->slug; ?>

And I would like to know how can I add the result of that code inside 'base' => '/HERE/' of paginate_links php code that looks like this:

<?php echo paginate_links( array( 'current' => $current_paginate_page, 'show_all' => true,'prev_next' => false, 'total' => $wp_query->max_num_pages, 'base' => '/HERE/', 'format' => '%#%' )); ?>

I just don't know how to correctly write it inside another php code. Please help, thank you!

http://wordpress.org/support/topic/single_cat_slug?replies=5 http://codex.wordpress.org/Function_Reference/paginate_links

  • 1
    "/$cat/" ?.. Please note the purely programming questions are not in scope here and are better asked at Stack Overflow. – Rarst Jul 3 '13 at 11:30

There is no need for any kind of (single or double) quotations:

... 'base' => $cat, ...

about quotations: https://stackoverflow.com/questions/3446216/what-is-the-difference-between-single-quoted-and-double-quoted-strings-in-php

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.