开发者 | claudiosanches |
---|---|
更新时间 | 2020年8月11日 07:02 |
捐献地址: | 去捐款 |
PHP版本: | 3.8 及以上 |
WordPress版本: | 5.5 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
Paste this code in functions.php
file of your theme:
add_filter( 'floating_nextprev_in_same_cat', '__return_true' );
Use this example in functions.php
file of your theme:
function floating_nextprev_exclude_categories( $excluded_categories ) {
$excluded_categories = '1,2,3'; // add your categories ids.
return excluded_categories;
}
add_filter( 'floating_nextprev_excluded_categories', 'floating_nextprev_exclude_categories' );
You can control the display using the floating_nextprev_display
filter.
Example how to display only in news category:
function floating_nextprev_only_in_news( $display ) {
return in_category( 'news' );
}
add_filter( 'floating_nextprev_display', 'floating_nextprev_only_in_news' );
Use the floating_nextprev_prev_title
and floating_nextprev_next_title
filters.
Example:
function floating_nextprev_prev_title( $title ) {
return __( '←', 'textdomain' );
}
add_filter( 'floating_nextprev_prev_title', 'floating_nextprev_prev_title' );
function floating_nextprev_next_title( $title ) {
return __( '→', 'textdomain' );
}
add_filter( 'floating_nextprev_next_title', 'floating_nextprev_next_title' );