Set a variable
$product_view=isset($_GET['product_view']) ? $_GET['product_view'] : 'grid';
Now, how to keep it like this with pagination URL’s.
echo paginate_links(array(
'base' => add_query_arg('product_view', $product_view),
'format' => '',
'prev_text' => __('«'),
'next_text' => __('»'),
'total' => ceil($total / $items_per_page),
'current' => $page,
'add_args' => array(
'category' => 'fruit',
'color' => 'red'
)
));
I hope this will help you to solve your problem.
Thank You,
Related Posts:
- Access the same page from multiple urls (wildcard)
- How to inject custom url path for page ?
- Remove number in URL
- Clean URL link for page without number
- How to Add a Rewrite Rule for Only One Page?
- Is there a way to create a URL (new WP page) that can only be accessed from a specific source?
- How to change only the home page / front page url on wordpress
- Blank Pages with # URL & Google
- Site url is not showing the home page
- Access the same page from multiple urls (wildcard)
- How to show the root webpage on all subpaths
- Organizing Your Pages
- How to add URL-Parameter for Javascript Widgets?
- How to create cutom link for page
- Separate URL for a specific page
- return page name in url
- How to fix broken URL – https://mywebsite.com/comments/feed/
- what does the symbol “?” mean and how can i edit that page?
- WordPress form submit to custom page template does not work
- Access link page and not folder content of that link
- New page has incorrect URL
- Is it possible to rewrite a page url Without setting the permalinks to Post Name?
- Temporary download page or restrict static download page based on how the user got to the page?
- How to change the default location where new post gets stored?
- Add infinite scroll to content splitted post
- Check if wp-login is current page
- How to get current page ID outside the loop?
- Contact Form on WordPress Sites?
- Page returns 404 with POST variables, but not without
- Custom templates not showing up in template dropdown
- Why “?v=hash” is added to my URLs? [closed]
- Get page id by template
- Using pre_get_posts on true pages and static front pages
- Get the content of a specific page (by ID)
- How to get page title with the page ID?
- Show more than 20 items in pages or posts edit dashboard
- Allowing user to edit only certain pages
- How to display last 3 posts (recent posts) in a static page?
- How to give paged links custom title?
- How to set post slug when using wp_insert_post();?
- How can I keep the content of my pages version controlled?
- How to load javascript on custom page template?
- How to configure WordPress to handle 75,000 pages?
- How to update page status from publish to draft and draft to publish
- Check if is on child-page of a particular page
- Change page template programmatically ?
- Conditional tag to check if ‘page.php’ is being used?
- Customizing the URLs of WordPress Login and Sign-up Pages?
- How to disable posts and use pages only
- featured image as background image on pages
- Check IF is a “single product page” and Check the “role” for a Redirect
- A check for if is parent page, if has children, if has grandchildren
- How to load JS and CSS only on specific Pages using is_page()?
- use query string in URL to display content on the page
- Listing pages which uses specific template [duplicate]
- Proper way to get page content
- Create a page without adding a page in the Database
- Is there a way to change the default page template selection?
- How to Check if a Page Exists by URL?
- Can I have two child pages of different parents with the same name?
- What methods to use to create small, editable pieces of text for static pages?
- Show Default Editor on Blog Page ( Administration Panel )
- Hide page visual editor if certain template is selected?
- What is the difference between $paged and $page?
- multi page password protection
- Create a “Dummy” parent page for a hierarchy in page listing?
- How do I convert a page’s title to lower case?
- Get top level page parent title
- How to add a specific widget to only 1 page?
- Restrict admin access to certain pages for certain users
- page title, parent tilte and grand parent title
- How to add jQuery script to an individual page?
- WordPress page edit does not save selected template
- Add a Page without header and menus?
- What is an alternative to get_page_by_title()?
- Password protect page with multiple passwords
- Strategy for handling hierarchical pages with empty parent content
- Create pages automatically if they don’t exist
- Find empty pages or pages which have less than x characters
- Allow only new sub-pages to be created
- Set page template automatically based on parent
- Editing Complex Pages in Visual Mode
- Link section within page with slash (/) and not hash (#) without reloading the page
- Creating a template using a specific slug name, for a page with a parent page
- Removing hierarchical pages in the permalink
- Can I display submenus in groups, using wp_list_pages?
- Is there a default template file for child pages / subpages?
- Get wp_get_attachment_url outside of loop
- How to check if feed URL was requested?
- Order by menu_order and title?
- Require title for pages
- WP Page and Subdirectory with same name
- Replace Dashes Before Title in Page List
- Add a new page to wordpress programmatically
- Get Permalink for the top level parent of child pages
- Proper method to restrict non logged users into certain pages
- How to redirect on particular page in wordpress? [closed]
- Get page id by title?
- What is the use of $page_title and how to use it?
- How to embed page content in a blog post