How to add a static text at end of a wordpress permalink

I couldn’t find a decent WordPress Way of doing this but a very effective Alternate. Please BACKUP your database before applying this solution. I went to PHPMYADMIN and applied this query: UPDATE wp_posts SET post_name = CONCAT(post_name,’-nj’) where post_type=”page” and post_parent <> 0 and all https://domain.com/county/city urls became https://domain.com/county/city-nj Please note that all “CITY” pages … Read more

Change custom post type permalink according to category

Change your rewrite to add the course query var: ‘rewrite’ => array(‘slug’ => ‘course/%course%’) Then filter post_type_link to insert the selected course into the permalink: function wpa_course_post_link( $post_link, $id = 0 ){ $post = get_post($id); if ( is_object( $post ) ){ $terms = wp_get_object_terms( $post->ID, ‘course’ ); if( $terms ){ return str_replace( ‘%course%’ , $terms[0]->slug … Read more

Custom content using in_category

in_category() accepts an array of categories to check against. So if you can get a list of all child categories for the parent category you want to check you can use that to see if your post is in any of those. You can do this by using get_categories() and specifying the parent. This will … Read more

permalink as content

Try to put this in functions.php of your theme. It’s untested in this form, but should work. /** * Change the Permalink on save / update */ function wpse_297006_rewrite_slug( $post_id, $post, $update ){ // check if it’s a post if (!(get_post_type( $post_id ) === ‘post’)) return; // check if it’s not a revision if (!(wp_is_post_revision( … Read more

Permalink Increments Not Updating/Removing

” so I have to go into the database “ Good. You know how to go to your database. Now what you can do is to check posts table for post_type page with slug drums, but not your one… some other, with different post_status (maybe trash, maybe draft). Once you remove duplicate from system you … Read more

Parent/Child Relationships with Multisites?

Yes – this would depend mostly on the theme. You would likely need to create a custom theme or a child theme which would present menus in the way you’re requesting, and you would want to go with a subfolder install vs. a subdomain install. I assume www.mainsite.com/multisite would be the “main” / parent MultiSite, … Read more