Permalinks changed with WordPress 4.9

Found the issue! Seems that the <Directory> in the .conf file in Apache2 was not configured correctly. An example of a correctly configured .conf file is as follows: # domain: exampleurl.com # public: /var/www/html/exampleurl.com/public_html/ <Directory /var/www/html/exampleurl.com/public_html> Require all granted AllowOverride All </Directory> <VirtualHost *:80> ServerAdmin [email protected] ServerName exampleurl.com ServerAlias www.exampleurl.com DocumentRoot /var/www/html/exampleurl.com/public_html ErrorLog /var/www/html/exampleurl.com/logs/error.log CustomLog … Read more

Add a URL prefix to permalinks of News category and sub-categories of posts only

add_action( ‘init’, ‘wpa_category_base’ ); function wpa_category_base() { // Remember to flush the rules once manually after you added this code! add_rewrite_rule( // The regex to match the incoming URL ‘news/([^/]+)/([^/]+)/([^/]+)(/[0-9]+)?/?$’, // The resulting internal URL ‘index.php?category_name=$matches[1]/$matches[2]&name=$matches[3]&paged=$matches[4]’, // Add the rule to the top of the rewrite list ‘top’ ); } Custom permalink structure: /media/%category%/%postname%/ Category … Read more

How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name

After combining a bunch of pieces of other answers I got it working! So here’s the solution for those of you who are struggling with this too: This post and this one helped me out some, so thanks to those guys. Note, all this code, plus your initial custom post type and taxonomy registration code … Read more