It’s a pretty simple solution – WP_Query utilizes the name
variable for posts and custom post type posts. It utilizes pagename
for pages, hence why ?name=product1-faqs
is not working. Use this instead:
add_rewrite_rule('product1/faqs/?', 'index.php?pagename=product1-faqs', 'top');
Related Posts:
- How can I modify the permalink via a filter?
- Newbie question: no index.php? in my plain wordpress permalink
- Change links automatically to affiliate links
- Rewrite sub folder dynamically with country code in WordPress using PHP
- Use WordPress’ URL rewrite engine
- Rename “Portfolio” slug?
- How to rewrite URL with PHP variables with htaccess to a normal looking URL?
- Static variable and add_rewrite_rule?
- Nesting if statements to echo only one string based on what tag was filtered?
- How to change home or site url using action hooks or filter?
- Performance impact of rewriting WordPress URLs
- Is sanitize_title_with_dashes formatting function too liberal (in terms of accepted characters)?
- Changes in permalink structure in WordPress and how to apply to in-site links
- WordPress Persistent connection rule does not work for “posts”
- Append query string to all URL’s
- custom rewrite rule help! Custom rewrite rules not applying to custom post type
- subdirectory index.php is not working
- Use URL Rewrite as well as $_GET parameters in URL?
- How to modify URL (add GET values) after front end form submission?
- parts of url disappear when using # inside href=”” [closed]
- Create custom permalinks to show Custom Post Type’s relationship?
- Add .htm extention to a custom taxonomy
- Help with .htaccess and Login with Subfolders
- WordPress add_rewrite_rules for custom URLs ending in .html
- Rewrite with pagination /foo/page/2/ to posts of a given category, page 2
- Divi change project category slug
- How to add a rewrite endpoint to unattached media?
- How do i add slugs to a URL, but still redirecting to the same page
- Nginx WordPress and another Web app URL structure
- Custom post type url Rewrite (conflicting with page url)
- WordPress Rewrite Rule
- Why is home page content not displaying with this rewrite rule?
- Modifying WP URL handing code?
- How to deal with a GET variable of ‘name’?
- How to define a rule in functions.php that ONLY disables the default wp functionality that undesirably changes ‘&’ to ‘#038;’?
- How to pass username in affiliate link in wordpress website
- Test the existence of a page/article by its URL, taking in consideration the URL rewriting by filters
- url not using query string no longer working
- Current WordPress Page Title as Search Parameter into A Tag
- How does one make a URL return dynamic JSON with custom Content Type?
- URL rewrite rule
- How does WordPress rewrite URLS using its PHP scripts
- How can I turn a url with get method as a clean url with segment as the get method?
- WordPress Rewrite Issue
- How to print redirected query string variables to the page?
- Multiple URL from Custom post name
- Why isn’t my custom function kicking in from my functions.php file?
- Difference in Get Variable Location
- WordPress adding in site URL to header links
- Dynamically append custom post type to end of url
- WordPress add parameters with friendly url structure
- Custom taxonomy with page post type – WordPress
- What do ++ and *+ mean?
- How can merge two arrays values in one array and save in database
- Network installation giving errors when viewing or adding a user
- Create a post variable processing page
- List all categories but exclude current post category on single post page
- Bare minimum to include in PHP file to use WP functions? [duplicate]
- Woocommerce, recognize the loop of related products
- How to return output of the new wp gallery block for automatically Link images To Media file
- Can an array be used as a meta_query value?
- WordPress different language footer text
- How do I target the child theme with get_bloginfo();?
- Getting a specific post values to another div or modal
- WordPress Configuration with SELinux on CentOS 8
- Modify function to print tags/categories/exclude tags/categories/ number of posts
- Accessing an image folder inside public web directory
- Change tinyMCE editor to allow marked content when pasting from Word
- add_action taking an array with the 2nd argument?
- Can WP plugins access files outside the installation folder?
- WP Insert Post and then go to post
- Add class to DIV depending on page loaded
- get_the_ID() in the footer returns wrong value
- How can I hook into the wp_mail function used by BackWPup?
- Syntax issue on rest object’s callback
- Get the users that my following users are following
- Hooks for post saving make a post-new.php to load latest post’s data
- WP_Query multiple post results
- How do I query a single data value from the wp_metadata table?
- Show field if it has contents on Advanced Custom Fields
- Class for Selected Menu using wp_nav_menu
- How to set all External Domain Links with nofollow Attribute from Header Footer Content and Excerpt using PHP?
- Adding image upload in tag section – WordPress plugin development
- WordPress sorting posts by date and title using a dropdown
- How to output the taxonomies that are assigned to each custom post?
- Conditional formatting on data fetched from MYSQL
- opens like sitename.com/URL
- file_get_contents returning different in filters and actions
- How do I remove an action hook inside a class that is called by another class?
- WP + MySql db / PHP
- Font rendering problem after using include in functions file
- Create page in templates for pages or the pages manager?
- Access preview settings in php
- wp_nav_menu prints children with parent name
- custom field meta-box with dropdown/autocomplete
- Does wp_query and query_posts affect website performance? [duplicate]
- Facebook share button only share the_permalink(), without thumbnail, tilte, excerpt, etc
- ACF | WooCommerce | Theme Development | How to include a /template-part/ that makes use of ACF’s on a custom WooCommerce homepage?
- Woocommerce – Shipping tax class based on cart items not using the highest tax available
- PHP $_SESSION array – only showing current index