Skip to content
WJunction - Webmaster Forum

Please help me with this small code

Status
Not open for further replies.

Divvy

Experienced Member
806
2009
18
Hello guys,

Can someone please help me with this small code?

PHP:
<?php
global $post;
$args = array( 'posts_per_page' => 20, 'post_type'=> 'freeGallery', 'portfolio_cat' => 'Featured');
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>

I have 46 posts in total.
I want to show 20 posts per page.
I added a pagination in the bottom of the page.

The problem with my code is that only is showing 20 posts in total, I dont have page 2 and 3 in my pagination, only page 1.
What I'm doing wrong? :)

Thanks for any help you can give!!

__________________
Added after 1 5 minutes:

Fixed! Thank you anyway guys
 
Last edited:

1 comment

Status
Not open for further replies.

About the author

D
Experienced Member · Joined
806
Messages
18
Reactions
18
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom