5 added 6 characters in body; edited tags; edited title
source | link

Pagination doesn't workDoesn't Work

I created myfile.php with the following content:I created myfile.php with the following content:

global $paged;
if ( get_query_var( 'paged' ) ) {
    $paged = get_query_var( 'paged' );
} else if ( get_query_var( 'page' ) ) {
    $paged = get_query_var( 'page' );
} else {
    $paged = 1;
}

$args = array(
    'post_type' => array('my_custom_post_type'),
    'paged' => $paged,
    'posts_per_page' => 3,
    'ignore_sticky_posts' => 1
);

$wp_query = new WP_Query( $args );
var_dump($wp_query);
if($wp_query->have_posts()) :
    while($wp_query->have_posts()) : $wp_query->the_post();
        // show post
    endwhile;
endif;

next_posts_link('Next posts');

wp_reset_query();
wp_reset_postdata();

and:

I have no idea what am I missing here but I just tried every single suggestion from troubleshooting guide on this page: https://codex.wordpress.org/Pagination - they suggest that "404 - not found" is one of the common problems when the permalinks are set to "Custom Structure" so WP developers are aware of some bug or issue but they don't say how to fix that.

My server is WAMP for Windows 7 (PHP 5.4.3, Apache 2.4.2, mod_rewrite enabled, custom link structures work great expect pagination when "myfile.php" is used as a page other than "Static Front Page").

My .htaccess when "Custom Permalink Structure" is set to "Post name":

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]
</IfModule>

# END WordPress

When I enter http://example.com/mypage/page/2 (doesn't work): SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'page' AND wp_posts.post_type = 'my_custom_post_type' ORDER BY wp_posts.post_date DESC

When I enter http://example.com/?page_id=1234&paged=2 (works): SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'my_custom_post_type' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') ORDER BY wp_posts.post_date DESC LIMIT 2, 2

Pagination doesn't work

I created myfile.php with the following content:

global $paged;
if ( get_query_var( 'paged' ) ) {
    $paged = get_query_var( 'paged' );
} else if ( get_query_var( 'page' ) ) {
    $paged = get_query_var( 'page' );
} else {
    $paged = 1;
}

$args = array(
    'post_type' => array('my_custom_post_type'),
    'paged' => $paged,
    'posts_per_page' => 3,
    'ignore_sticky_posts' => 1
);

$wp_query = new WP_Query( $args );
var_dump($wp_query);
if($wp_query->have_posts()) :
    while($wp_query->have_posts()) : $wp_query->the_post();
        // show post
    endwhile;
endif;

next_posts_link('Next posts');

wp_reset_query();
wp_reset_postdata();

and:

I have no idea what am I missing here but I just tried every single suggestion from troubleshooting guide on this page: https://codex.wordpress.org/Pagination - they suggest that "404 - not found" is one of the common problems when the permalinks are set to "Custom Structure" so WP developers are aware of some bug or issue but they don't say how to fix that.

My server is WAMP for Windows 7 (PHP 5.4.3, Apache 2.4.2, mod_rewrite enabled, custom link structures work great expect pagination when "myfile.php" is used as a page other than "Static Front Page").

My .htaccess when "Custom Permalink Structure" is set to "Post name":

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]
</IfModule>

# END WordPress

When I enter http://example.com/mypage/page/2 (doesn't work): SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'page' AND wp_posts.post_type = 'my_custom_post_type' ORDER BY wp_posts.post_date DESC

When I enter http://example.com/?page_id=1234&paged=2 (works): SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'my_custom_post_type' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') ORDER BY wp_posts.post_date DESC LIMIT 2, 2

Pagination Doesn't Work

I created myfile.php with the following content:

global $paged;
if ( get_query_var( 'paged' ) ) {
    $paged = get_query_var( 'paged' );
} else if ( get_query_var( 'page' ) ) {
    $paged = get_query_var( 'page' );
} else {
    $paged = 1;
}

$args = array(
    'post_type' => array('my_custom_post_type'),
    'paged' => $paged,
    'posts_per_page' => 3,
    'ignore_sticky_posts' => 1
);

$wp_query = new WP_Query( $args );
var_dump($wp_query);
if($wp_query->have_posts()) :
    while($wp_query->have_posts()) : $wp_query->the_post();
        // show post
    endwhile;
endif;

next_posts_link('Next posts');

wp_reset_query();
wp_reset_postdata();

and:

I have no idea what am I missing here but I just tried every single suggestion from troubleshooting guide on this page: https://codex.wordpress.org/Pagination - they suggest that "404 - not found" is one of the common problems when the permalinks are set to "Custom Structure" so WP developers are aware of some bug or issue but they don't say how to fix that.

My server is WAMP for Windows 7 (PHP 5.4.3, Apache 2.4.2, mod_rewrite enabled, custom link structures work great expect pagination when "myfile.php" is used as a page other than "Static Front Page").

My .htaccess when "Custom Permalink Structure" is set to "Post name":

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]
</IfModule>

# END WordPress

When I enter http://example.com/mypage/page/2 (doesn't work): SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'page' AND wp_posts.post_type = 'my_custom_post_type' ORDER BY wp_posts.post_date DESC

When I enter http://example.com/?page_id=1234&paged=2 (works): SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'my_custom_post_type' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') ORDER BY wp_posts.post_date DESC LIMIT 2, 2

    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
4 edited tags
| link
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
    Bumped by Community user
3 added 522 characters in body
source | link

I created myfile.php with the following content:

global $paged;
if ( get_query_var( 'paged' ) ) {
    $paged = get_query_var( 'paged' );
} else if ( get_query_var( 'page' ) ) {
    $paged = get_query_var( 'page' );
} else {
    $paged = 1;
}

$args = array(
    'post_type' => array('my_custom_post_type'),
    'paged' => $paged,
    'posts_per_page' => 3,
    'ignore_sticky_posts' => 1
);

$wp_query = new WP_Query( $args );
var_dump($wp_query);
if($wp_query->have_posts()) :
    while($wp_query->have_posts()) : $wp_query->the_post();
        // show post
    endwhile;
endif;

next_posts_link('Next posts');

wp_reset_query();
wp_reset_postdata();

and:

I have no idea what am I missing here but I just tried every single suggestion from troubleshooting guide on this page: https://codex.wordpress.org/Pagination - they suggest that "404 - not found" is one of the common problems when the permalinks are set to "Custom Structure" so WP developers are aware of some bug or issue but they don't say how to fix that.

My server is WAMP for Windows 7 (PHP 5.4.3, Apache 2.4.2, mod_rewrite enabled, custom link structures work great expect pagination when "myfile.php" is used as a page other than "Static Front Page").

My .htaccess when "Custom Permalink Structure" is set to "Post name":

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]
</IfModule>

# END WordPress

When I enter http://example.com/mypage/page/2 (doesn't work): SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'page' AND wp_posts.post_type = 'my_custom_post_type' ORDER BY wp_posts.post_date DESC

When I enter http://example.com/?page_id=1234&paged=2 (works): SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'my_custom_post_type' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') ORDER BY wp_posts.post_date DESC LIMIT 2, 2

I created myfile.php with the following content:

global $paged;
if ( get_query_var( 'paged' ) ) {
    $paged = get_query_var( 'paged' );
} else if ( get_query_var( 'page' ) ) {
    $paged = get_query_var( 'page' );
} else {
    $paged = 1;
}

$args = array(
    'post_type' => array('my_custom_post_type'),
    'paged' => $paged,
    'posts_per_page' => 3,
    'ignore_sticky_posts' => 1
);

$wp_query = new WP_Query( $args );
var_dump($wp_query);
if($wp_query->have_posts()) :
    while($wp_query->have_posts()) : $wp_query->the_post();
        // show post
    endwhile;
endif;

next_posts_link('Next posts');

wp_reset_query();
wp_reset_postdata();

and:

I have no idea what am I missing here but I just tried every single suggestion from troubleshooting guide on this page: https://codex.wordpress.org/Pagination - they suggest that "404 - not found" is one of the common problems when the permalinks are set to "Custom Structure" so WP developers are aware of some bug or issue but they don't say how to fix that.

My server is WAMP for Windows 7 (PHP 5.4.3, Apache 2.4.2, mod_rewrite enabled, custom link structures work great expect pagination when "myfile.php" is used as a page other than "Static Front Page").

My .htaccess when "Custom Permalink Structure" is set to "Post name":

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]
</IfModule>

# END WordPress

I created myfile.php with the following content:

global $paged;
if ( get_query_var( 'paged' ) ) {
    $paged = get_query_var( 'paged' );
} else if ( get_query_var( 'page' ) ) {
    $paged = get_query_var( 'page' );
} else {
    $paged = 1;
}

$args = array(
    'post_type' => array('my_custom_post_type'),
    'paged' => $paged,
    'posts_per_page' => 3,
    'ignore_sticky_posts' => 1
);

$wp_query = new WP_Query( $args );
var_dump($wp_query);
if($wp_query->have_posts()) :
    while($wp_query->have_posts()) : $wp_query->the_post();
        // show post
    endwhile;
endif;

next_posts_link('Next posts');

wp_reset_query();
wp_reset_postdata();

and:

I have no idea what am I missing here but I just tried every single suggestion from troubleshooting guide on this page: https://codex.wordpress.org/Pagination - they suggest that "404 - not found" is one of the common problems when the permalinks are set to "Custom Structure" so WP developers are aware of some bug or issue but they don't say how to fix that.

My server is WAMP for Windows 7 (PHP 5.4.3, Apache 2.4.2, mod_rewrite enabled, custom link structures work great expect pagination when "myfile.php" is used as a page other than "Static Front Page").

My .htaccess when "Custom Permalink Structure" is set to "Post name":

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]
</IfModule>

# END WordPress

When I enter http://example.com/mypage/page/2 (doesn't work): SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'page' AND wp_posts.post_type = 'my_custom_post_type' ORDER BY wp_posts.post_date DESC

When I enter http://example.com/?page_id=1234&paged=2 (works): SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'my_custom_post_type' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private') ORDER BY wp_posts.post_date DESC LIMIT 2, 2

2 added 368 characters in body
source | link
1
source | link