开发者

Wordpress second page displays the same content as my first

开发者 https://www.devze.com 2023-04-03 23:21 出处:网络
I\'m seeing my 2nd page displaying the exact same content as my first page. I followed some articles online and added

I'm seeing my 2nd page displaying the exact same content as my first page.

I followed some articles online and added

<?php $paged = (get_query_var('paged')) ? get_q开发者_如何学Cuery_var('paged') : 1; ?>
<?php query_posts('showposts=16&paged=$paged'); ?>

just one line above my

<?php while (have_posts()) : the_post(); ?>

But it's still the same... please help mee!!

edit: a link might have been helpful => http://nailian.ca/


here's your problem:

<?php query_posts('showposts=16&paged=$paged'); ?>

it should be:

<?php query_posts("showposts=16&paged=$paged"); ?>

Notice the different quote sign? on single quote, dollar sign is treated as is, not parsed as variable as stated in PHP doc:

Note: Unlike the double-quoted and heredoc syntaxes, variables and escape sequences for special characters will not be expanded when they occur in single quoted strings.

0

精彩评论

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

关注公众号