使用Bootstrap隐藏命令定位标题

时间:2016-05-13 10:08:16

标签: php html wordpress twitter-bootstrap

我有以下代码为Wordpress帖子创建上一个和下一个链接。我想要隐藏链接的标题,并将文字替换为链接标题' back'和' next'

当前代码隐藏了标题旁边的图标(表示Bootstrap正在运行)但不隐藏标题

    <nav role="navigation" id="<?php echo esc_attr( $nav_id ); ?>" class="<?php echo $nav_class; ?>">

<?php if ( is_single() ) : // navigation links for single posts ?>

    <?php previous_post_link( '<div class="nav-previous">%link</div>', '<span class="hidden-xs fa fa-chevron-up icn-L"></span>'. _x( get_previous_post()->post_title, '<span class="hidden-xs">Next post link</span>', 'bnNav' ) ); ?>
    <?php next_post_link( '<div class="nav-next">%link</div>',  _x( get_next_post()->post_title, 'Previous post link', 'bnNav' ). '<span class="hidden-xs fa fa-chevron-up icn-R"></span>' ); ?>

...

1 个答案:

答案 0 :(得分:2)

编辑回答

<?php previous_post_link( '<div class="nav-previous">%link</div>', '<span class="hidden-xs fa fa-chevron-up icn-L">%title</span><span class="hidden-lg hidden-md hidden-sm ">Back</span>' ); ?>

<?php next_post_link( '<div class="nav-next">%link</div>',  '<span class="hidden-lg hidden-md hidden-sm ">Next</span><span class="hidden-xs fa fa-chevron-up icn-R">%title</span>' ); ?>