Hot answers tagged

4

The Why Part If we have a page called technical and try to load: example.tld/technical/99999999999999999999 then the 99999999999999999999 part is treated as a page query variable with the value of 2147483647. The reason is this rewrite rule for pages: according to the handy Monkeyman Rewrite Analyzer by Jan Fabry. This part of the ...


4

You need a rewrite rule! First things first let's get that in place: function wpse_226796_rewrite_rule( $rules ) { global $wp_rewrite; // http://php.net/manual/en/reference.pcre.pattern.syntax.php $regex = 'postcomment-page/([1-9][0-9]*)-paged-([1-9][0-9]*)\.html'; $query = sprintf( ...


2

Flushing the rewrite rules - which you can do just by visiting the Settings -> Permalinks page - was a good step to take, because it's usually the overlooked cause of these sorts of issues. However as Milo said in the comments, in this case, it's just that the publicly_queryable argument needs to be true if you want these posts to display on the frontend. ...


1

Here is what I ended up with. Needs some clean up on my end still but it works. https://gist.github.com/curtismchale/fa8d0570ce2c9b14880f31766c560872


1

You should hook add_rewrite_rule() into init Assuming http://local/rieltplus/ is your homepage, and category/catalog/ is a category archives, this should work: add_action('init', function() { add_rewrite_rule( 'category/catalog/([^/]+)?$', ...


1

I am not sure I follow your question, title seems different from question itself. You seem to want to get rid of index.php in URL? It's hard to say confidently from outside, but it looks like PATHINFO permalink. If that's the case you would need to change your WP permalink configuration to more common "pretty" one. Doesn't have anything to do with CPT's ...


1

Heh, I needed it as well and the solution is this plugin custom-permalinks . However it doesn't create url itself (ask-anything/%postname%). So you have to create yourself or do what I did - I made a little upgrade and added js (check if category is checked or not and if category is ask-anything - if true - it'll change url with js / if false - nothing ...



Only top voted, non community-wiki answers of a minimum length are eligible