New answers tagged

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/([^/]+)?$', ...


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. ...


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 ...


0

You can achieve your task in both ways through plugin as well as coding Manually Please see the documentation on URLs of Namespaced Custom Post Types Identifiers. One of the options available to you is to add a 'rewrite' argument to register_post_type(). From the docs: Plugin Custom Post Type Permalinks allow you edit the permalink structure of custom ...


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

Change or add the 'rewrite' => array( 'slug' => 'luckydraw', 'with_front' => false ), into the register_post_type arguments, This will change the slug of your custom post type.


0

I just examined your URL http://www.homecredit.ph/wp-content/uploads/home1/homecre1/public_html/files/News-26.jpg and code and noticed that, you are saving your image in http://www.homecredit.ph/files/News-26.jpg path but trying to access from upload directory of WordPress. /home1/homecre1/public_html/files/News-26.jpg - this is the path stored in database ...


0

I think your issue is with the rewrite portion when you registered the custom taxonomy with posts. 'rewrite' => array('slug' => 'some-slug', 'with_front' => false) You can replace some-slug with anything you would like. It might be possible to replace it with article/event-category to get the results you want. Setting with_front to false removes ...


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 ...


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( ...


0

You can use a rewrite rule in your htaccess: /for-rent/turkey/istanbul RewriteRule ^for-rent/([^/]*)/([^/]*)$ yourpage.php?country=$1&city=$2 [L] Than in your yourpage.php: $country = $_REQUEST['country']; $city = $_REQUEST['city'];


0

I have added extra rewrite rules for pages with no item_width and item_height in combination with pagination as follows: /** * Adds rewrite rules for shop category */ function gtp_add_shop_rewrite_rules() { // shop-category/category/item_width/item_height/page/2/ add_rewrite_rule( '^shop-category\/([^/]*)\/([^/]*)\/([^/]*)\/page\/([0-9]*)$', ...



Top 50 recent answers are included