另一个php代码中的类别插件

时间:2013-07-03 作者:user2546160

我使用此代码在循环之外的categories archive页面上获取categories slug:

<?php $cat = get_term_by(\'name\', single_cat_title(\'\',false), \'category\'); echo $cat->slug; ?>
我想知道如何在paginate\\u links php代码的“base”=>“/HERE/”中添加该代码的结果,如下所示:

<?php echo paginate_links( array( \'current\' => $current_paginate_page, \'show_all\' => true,\'prev_next\' => false, \'total\' => $wp_query->max_num_pages, \'base\' => \'/HERE/\', \'format\' => \'%#%\' )); ?>
我只是不知道如何在另一个php代码中正确地编写它。请帮忙,谢谢!

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

1 个回复
SO网友:user63457

不需要任何类型的(单或双)报价:

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

关于报价:https://stackoverflow.com/questions/3446216/what-is-the-difference-between-single-quoted-and-double-quoted-strings-in-php

结束