How do I get all the URLs from my WordPress site?

I used the WooCommerce API and this code: <?php set_time_limit(0); // Include the client library require_once ‘class-wc-api-client.php’; $consumer_key = ‘XXXX’; // Add your own Consumer Key here $consumer_secret=”XXXX”; // Add your own Consumer Secret here $store_url=”http://www.example.com/”; // Add the home URL to the store you want to connect to here // Initialize the class $wc_api … Read more

How to create thousands of endpoints for a post or a page or a custom post type programatically?

It’s not clear from your question if you actually want the word/number structure or you merely use numbers to distinguish endpoints as different. Natively in WordPress there is no concept of endpoint with variable name. You can use add_rewrite_endpoint() to create a endpoint endpoint, which will match requests like …/endpoint/123, …/endpoint/124, and so on to … Read more

Rewrite rule to prettify two $_GET variables while in a new endpoint from a page

I think you are using endpoints incorrectly. When a endopoint is created, a new rewrite rule is created using a query var with the same name of the endpoint; its value is taken from the string that follows the endpoint definition. So, if you register “my-endpoint” and build this URL: /page-slug/my-endpoint/123/some-string The endpoint is passed … Read more

Parent & Child Taxonomy slugs in custom post permalink

To handle the extra URL segment you need to add another rewrite rule similar to the one generated by add_permastruct, but with an extra capture group and slash for the additional level of terms: add_rewrite_rule( ‘book/([^/]+)/([^/]+)/([^/]+)-blah-blah-blah?(:/([0-9]+))?/?$’, ‘index.php?post_type=book&name=$matches[3]’, ‘top’ ); Also, as I mentioned in my comment, the query var and slug author are already in … Read more

Permalinks: Page Not Found

Do you have mod_rewrite enabled? This sort of thing tends to happen when it’s not. At which point, you only have access to ugly permalinks (?p=N) or “almost pretty” permalinks (/index.php/slug). The latter uses pathinfo to get you the page you’re requesting instead. So I’d suggest double checking whether mod_rewrite is installed and enabled. If … Read more

Permalink Structure CPT With Custom Taxonomy Fails

Setting has_archive to true causes WordPress to generate a rewrite rule for the archive using the rewrite slug, which is not what you want in your case. Instead, explicitly specify the archive slug as a string and the correct rules will be generated: $args = array( ‘has_archive’ => ‘courses’, ‘rewrite’ => array(‘slug’ => ‘courses/%course-type%’,’with_front’ => … Read more