How to remove slug from CPT correctly?

This is a two-step process. First, you need to remove the slug from the default URL. (use a unique slug while registering the CPT). function wpse413969_remove_cpt_slug( $post_link, $post ) { if ( $post->post_type == ‘YOUR_CPT’ && $post->post_status == ‘publish’) { $post_link = str_replace( “https://wordpress.stackexchange.com/” . $post->post_type . “https://wordpress.stackexchange.com/”, “https://wordpress.stackexchange.com/”, $post_link ); } return $post_link; } … Read more

Iterating over every multisite / theme and list the pages

due to Rick Hellewells comment I could write a code, which iterates over every blog (as a blog is a new mulitiste site) and outputs it’s site on plugin activation. See this link: https://wisdmlabs.com/blog/how-to-list-posts-from-all-blogs-on-wordpress-multisite/ As every site has it’s own theme, the $temp variable can hold the wp_get_theme command (you could also extract the site’s … Read more