简体   繁体   English

添加div阅读更多wordpress

[英]Adding a div Read More wordpress

Ok so I am trying to add a div read more button but it's not working, and I'm not sure how to go about this. 好的,所以我试图添加一个div阅读更多按钮,但是它不起作用,并且我不确定如何进行此操作。

here is the code I am trying to use. 这是我尝试使用的代码。

<?php the_content('<a href="<?php the_permalink() ?>" title="<?php printf( __('Permalink to %s', 'wpbx'), the_title_attribute('echo=0') ) ?>" rel="bookmark"><div class="readmore"></div></a>') ?>

here is the css 这是CSS

.readmore{
  width:136px;
  height:34px;
  background: url('http://ericavain.com/wp-content/uploads/2013/04/READ1.png') no-repeat;
}
.readmore:hover{
  width:136px;
  height:34px;
  background: url('http://ericavain.com/wp-content/uploads/2013/04/read2.png') no-repeat;
}

How do i get this accomplished 我如何做到这一点

Maybe you are trying to use "read more" on Pages? 也许您正在尝试在Pages上使用“阅读更多信息”? If that is the case try adding something like this to your page: 如果是这种情况,请尝试在页面中添加如下内容:

<?php  // let's enable more link on pages...
        global $more;
        $more = 0;
        ?>
            <?php the_content(); ?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM