开发者

Why is it I cant set a get variable

I am appending ?readmore=true to the end of a url in wordpress

<a href="<?php the_permalink(); ?>?readmore=true" class="readmore">
  <span><?php _e('Read more','MyProduct'); ?></span>
</a>

but on the next page I tried this

<?php
  print_r($_GET);
  if($_GET['readmore'] == 开发者_JAVA技巧"true") {
  get_header();
  }
?>

and in my print_r

I get this

 Array ( [page_id] => 8?readmore=true ) 

Am I missing something about get variables in wordpress


Try to append &readmore=true instead of ?readmore=true.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜