How to: change permalink by category?

Open to admin dashboard > Settings > Permalinks, select “Custom Structure”, enter: /%category%-%postname%/ and click “Save Changes”. Or, you might consider separating the two with a forward slash: /%category%/%postname%/ Using the /%category%-%postname%/ custom permalink structure, the News category will show as /news-%postname%. For the Game category, since the name is different than the desired permalink, … Read more

Configuring Home Page Address

If there is no clear evidence of any present redirect from the following sources: The htaccess, both under the public_html and under the public_html/folder (where folder is the directory having all the wp files), removing and regenerating them by mean of updating the permalinks, The .htaccess files were at some point deleted, and regenerated, The … Read more

Change permalink to attachment

If you change the structure of the permalink, you have to provide the rewrite rules to understand the new structure. Also, you are not building the attachment permalink correctly. The next code is working: add_filter( ‘attachment_link’, ‘wpd_attachment_link’, 20, 2 ); function wpd_attachment_link( $link, $attachment_id ){ $attachment = get_post( $attachment_id ); // Only for attachments actually … Read more