Paginate Child Pages Content on Parent Page

After some searching I was able to find this post: http://wordpress.org/support/topic/add-pagination-to-list-of-child-pages My final code looks like this: <?php $ids = array(); $pages = get_pages(“child_of=”.$post->ID); if ($pages) { foreach ($pages as $page) { $ids[] = $page->ID; } } $paged = (get_query_var(“paged”)) ? get_query_var(“paged”) : 1; $args = array( “paged” => $paged, “post__in” => $ids, “posts_per_page” => … Read more

Pagination gives 404 in template

I did what Rarst told me to do. First I searched around in the Pods Framework documentation. This solved my problem. Here’s what the code looks like right now. <?php $params = array( ‘orderby’ => ‘publish_date.meta_value DESC’, ‘limit’ => 10 ); $fltNewsPods = pods( ‘fltnews’, $params ); while ($fltNewsPods->fetch()) { echo “<li class=”content-list-item”>”; $podsForNewsItem = … Read more

Getting pagination for second loop to work on single.php

Here’s a working example of a secondary loop with pagination that can be used on singular posts. WP_Query is typically a better way to go than query_posts(). Your permalink settings shouldn’t be a factor here. <?php $my_query = new WP_Query( [ ‘posts_per_page’ => 3, ‘paged’ => ( get_query_var( ‘paged’ ) ) ? get_query_var( ‘paged’ ) … Read more

Why am I getting a 404 on anything past page 1 of my query?

So, it turns out my hunch was correct and the solution is to add some rewrite rules. Here’s what I added: function owr_blog_rewrite( $rules ) { return [ ‘notes/topic/([^/]+)/?$’ => ‘topic=$matches[1]’, ‘notes/topic/([^/]+)/page/([0-9]+)/?$’ => ‘topic=$matches[1]&paged=$matches[2]’, ] + $rules; } add_filter( ‘rewrite_rules_array’, ‘owr_blog_rewrite’ ); Everything works as expected now

wordpress Next/Previous post in same category not working

I use the following code to Displays Next/Previous link in same posts category and work correctly for me. <?php get_template_part( ‘content’, get_post_format() ); // Previous/next post navigation. previous_post_link(‘%link”https://wordpress.stackexchange.com/questions/344307/,”Before’, true ); next_post_link( ‘%link”https://wordpress.stackexchange.com/questions/344307/,”Next’, true ); ?> And For CSS Styling the “%link” Element I use this code in my functions.php file. /////Next/Prev post style add_filter(‘next_post_link”https://wordpress.stackexchange.com/questions/344307/,”next_post_link_attributes’); add_filter(‘previous_post_link”https://wordpress.stackexchange.com/questions/344307/,”previous_post_link_attributes’); … Read more

In pagination, change link for page 1 to homepage

You can do a simple str_replace( ‘/page/1/’, “https://wordpress.stackexchange.com/”, $string ) on the results generated by paginate_links() to get rid of /page/1/ which appears on the first page link as well as the Prev link (when it points to the first page). Here’s a full (tested) example: /** * Numeric pagination via WP core function paginate_links(). … Read more

Having issues with wordpress pagination with multiple categories

I did more research and found a plugin that corrects the pagination issues with multiple categories. To summarize, I am using using a plugin called WordPress Category Archive – www.wordpress.org/extend/plugins/wp-category-archive/ to display my category specific archive. There were some issues with pagination due to the year/month being included in the url. The Solution: A plugin … Read more

Getting 404 on taxonomy page

I’ve solved this for myself with rewrite rule. The story: I have “piece” custom post type, taxonomy “media_tag” with “m_audio” term and taxonomy “genre_tag” with “g_sacred”, “g_folk” etc. And I want to have an URL like /piece/audio/<genre> to access archives. So, now I have in my functions.php: add_filter( ‘rewrite_rules_array’, ‘my_insert_rewrite_rules’ ); function my_insert_rewrite_rules( $rules ) … Read more

How to let crawlers search paginated comments?

The reason of why Google doesn’t index paginated comments is because of an issue with the canonical URL in your header. You can learn more about the reason behind this in a comprehensive question that I posted earlier. There is an excellent solution posted there for paginated post pages. Now, for Google to index comment … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)