New answers tagged

3

since WP 4.4.0, you can use this filter that allows you to change the arguments used in the original cpt registration. Add this to your functions.php file: add_filter( 'register_post_type_args', function( $args, $post_type ) { if( 'wyde_portfolio' === $post_type && is_array( $args ) ) $args['rewrite']['with_front'] = false; ...


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


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


0

Don't touch the .htaccess file, there's this neat tool add_rewrite_rule() which you should hook into init: add_action('init', function() { add_rewrite_rule( 'search+([^/]+).html$', 'index.php?my_custom_search=1&s=$matches[1]&submit=Search', 'top' ); }); Right after that you should flush the rewrite rules once ( by ...



Top 50 recent answers are included