Currently I’m having URL for pagination pages as: http://www.example.com/category_name/page/2 But I need to change this URL structure as: http://www.example.com/category_name/?page=2 etc. any solution?
Static front page pagination working fine on localhost. but when i uploaded the to server online its not working. i am using infinite scroll. the issue is only with static front page, when i don't use static front page then it works. here is my code, help will be really appreciated! <?php /* Template Name: Layout 1 */ ?> <?php get_header(); ?> <div class="main"> <div class="container"> <div class="sixteen columns"> <div class="portfolio-all-main"> <?php if ( get_query_var('paged') ) { $paged = get_query_var('paged'); …
I create a page in wordpress series.php and here it the code where I block! <?php $categories=get_categories( array( 'parent' => $cat->cat_ID) ); foreach ($categories as $c) { // what you really want instead of var_dump is something to // to create markup-- list items maybe, For example $idp = $c->term_taxonomy_id; //then i get the data from the database $cat_data = get_option("category_".$idp); ?> <div class="wide-box"> <!-- Content Detail Box --> <a href="<?php echo get_category_link( $idp ); ?>" class="wb-image"><img src="<?php echo $cat_data['original_img']; …
I have set up an archive page for my custom post type reference, where I use a query to get all posts of type reference. This works, but when I try to paginate the result, it doesn't work. Right now, it doesn't even print out the pagination links. EDIT: This was earlier used on a regular page, but I changed it to an archive page. That's when the pagination broke. Here is the source code; Custom post type reference (plugin) …
I have adjacent posts set up correctly but it's displaying all of the posts/pages. I need it to show specific ones. The easiest way would be by parent URL if that's possible as I need to do this multiple times. So www.example.com/sydney/ would be the URL and every page that uses the sydney parent would be displayed and nothing else. It doesn't have to be this way if there is a better/easier way then I am all ears. /** * …
I want to modify the output of wp_link_pages. Basically what I need is to show Previous and Next buttons and current page/total number of pages. I created the Previous and Next button. Now in between them I want to add a current page and the total pages number. Here is my code wp_link_pages( array( 'before' => '<div class="page-links">' . __(''), 'after' => '</div>', 'next_or_number' => 'next', 'nextpagelink' => __('Next'), 'previouspagelink' => __('Previous'), 'pagelink' => '%', 'echo' => 1, ) ); …
I have a problem with pagination on my front page. I want to show all posts from a specific category and paginate them. Here is the code if ( is_front_page() ) { $paged = get_query_var( 'page' ) ? get_query_var( 'page' ) : 1; $args = array( 'post_type' => 'post', 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => 1, 'cat' => '4', 'page' => $paged, ); $q = new WP_Query( $args ); if ( $q->have_posts() ) { while ( $q->have_posts() ) …
EDIT: So I've done some troubleshooting and it seems my theme isn't showing woocommerce search results. The 2017 theme does so I am trying to figure out what my theme is missing. I suspect something in the functions.php file. It's something I'm leaving out, not something I've included that's interfering, because I deleted all my code out of the functions file line by line and nothing changed. I have some custom code I have used elsewhere without any trouble. I …
How do we get wp_link_pages() to show the Next and Previous button when it is the start of the multi-page post as well at the end of a multipage. Currently it only shows Next if it is the first page, and Previous at the end of the page.
Can this function... function custom_pagination_base() { global $wp_rewrite; $wp_rewrite->pagination_base = 'p'; $wp_rewrite->flush_rules(); } add_action( 'init', 'custom_pagination_base' ); ...be somehow used to change the from of the url from "page/2/" not to "p/2/" but to "?p=2"?
I'm recently added this code to my Wordpress website to add .html for my product category. It worked okay with the category (http://mywebsite.com/parent-category/product-category.html) but when I clicked the pagination, the link turned into (http://mywebsite.com/parent-category/product-category.html/page/2) This is a code that i added to function.php on my site function wpse_178112_category_permastruct_html( $taxonomy, $object_type, $args ) { if ( $taxonomy === 'product_cat' ) add_permastruct( $taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%.html", $args['rewrite'] ); } add_action( 'registered_taxonomy', 'wpse_178112_category_permastruct_html', 10, 3 ); Please help, I'm just a Wordpress newbie . Thank …
I created a new tab called "Videos" inside of the BuddyPress Profile page. This tab contains all video posts added by that user. The problem is that it only shows the first 12 posts and the pagination does not show up. I did try to include the pagination code provided by the theme but to no avail. Notes: I am using a theme called "VideoTube" The post loop to be paginated is from a custom post type called "video" The …
The backstory is I noticed the homepage was generating infinite paginated pages. This is a custom built theme. I was using index.php and WP_Query to create 2 small 5 post loops. I figured WP_Query was pulling all of the qualifying posts and then limiting to the most recent 5, so I switched to get_posts with a foreach loop, since my understanding is that doesn't fetch all the posts, only the ones you ask for (and therefore no need for pagination). …
I am trying to configure WordPress 5.9 to allow numeric slugs for child pages. Drawing from the 2015 answer to a similar question I took the up-to-date code of wp_unique_post_slug, removed || preg_match( "@^($wp_rewrite->pagination_base)?\d+$@", $slug ) and then added it as the following hook to my theme's functions.php. But for some reason, I just get a critical error: "Allowed memory size exhausted". What can I do to allow numeric slugs for child pages? add_filter( 'wp_unique_post_slug', function ( $slug, $post_ID, $post_status, …
I've got custom taxonomy archive pages with a drop down list that allows users to re-order/sort the posts. It basically waits for the user to select from the drop down then uses array_merge( $wp_query->query..... to create a new query and re-sort the posts. This works fine. I also use wp-pagination to display numbered pagination. This also works fine. The problem is, when a user re-sorts the list, and then clicks on the pagination to go to page 2 the new …
I wrote a very long page with a lot of content and would like to add a pagination to make it more readable. I added in the texteditor several <!–-nextpage–-> but it doesn't create any pagination, although in the default twentythirteen page template the wp_link_pages function is called <?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentythirteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> I'm using a child theme …
My home is a static page, but Wordpress create enumeration "home/page/2/.../3/" and the only solution found that disable pages generation, also redirecting, is the instruction below, but I would like it to have effect only the home page and not the whole site. Thank you in advance for any suggestions. global $posts, $numpages; $request_uri = $_SERVER['REQUEST_URI']; $result = preg_match('%\/(\d)+(\/)?$%', $request_uri, $matches); $ordinal = $result ? intval($matches[1]) : FALSE; if(is_numeric($ordinal)) { setup_postdata($posts[0]); $redirect_to = ($ordinal < 2) ? '/': (($ordinal > …
First of all: I don't understand the meaning or the action that http://myurl/page/2 does? I checked the Net tab in Firebug and saw that my page takes more than 3 seconds to load /page/2... but I don't need pagination at my front page at all. I don't get where it comes from either. My question: how do I disable / remove this and show it only when pagination is needed? This is the query I am using to get posts: …
I am trying to add pagination for my Archive. I want to show 12 posts per page and then show the 'next' / 'previous' buttons. When I manually change the value of the $paged variable, the 1 into a 2 it works. When I click the Next button on the archive page, it loads a very weird theme page. The url looks like: '/page/2/'. What am I doing wrong? This is the code I wrote so far: <?php global $paged,$wp_query; …
I'm trying to add pagination to my WordPress query using pagination_links() however I am getting no links returned for my page 1 links and previous link? Other links are adding the paged query string to the URL which then redirect you to /page/3/ for example. Unsure whether I need to update the query below to add these URL's instead of the query string? Can anyone see what is wrong with the below and how I can get the pagination links …