web.config breaks the themes for sub-directory multisite

I asked our hosting provider for help and they modified the first web.config to work. <?xml version=”1.0″ encoding=”UTF-8″?> <configuration> <system.webServer> <!– <security> <authentication> <basicAuthentication enabled=”false”/> <anonymousAuthentication enabled=”false”/> </authentication> </security>–> <rewrite> <rules> <rule name=”WordPress Rule 1″ stopProcessing=”true”> <match url=”^index\.php$” ignoreCase=”false” /> <action type=”None” /> </rule> <rule name=”WordPress Rule 2″ stopProcessing=”true”> <match url=”^([_0-9a-zA-Z-]+/)?files/(.+)” ignoreCase=”false” /> <action type=”Rewrite” … Read more

Rewrite slug of custom post type to include post-id

Try this : function change_post_type_link( $link, $post = 0 ){ if ( $post->post_type == ‘questions’ ){ return home_url( ‘questions/’. $post->post_name .”https://wordpress.stackexchange.com/”. $post->ID ); } else { return $link; } } add_action( ‘init’, ‘change_rewrites_init’ ); function change_rewrites_init(){ add_rewrite_rule( ‘questions/([a-z-]+)/([0-9]+)?$’, ‘index.php?post_type=questions&p=$matches[1]&postid=$matches[2]’, ‘top’ ); } Here post slug is attached after questions in the URL. For example questions/q-slug/45. … Read more

How to change home or site url using action hooks or filter?

Ok. Then you can use template_redirect hook and wp_is_mobile() conditional tag. wp_is_mobile() will work on device only. If you resize the window then it will not work. Now you can try this kind of code in your functions.php file add_action(‘template_redirect’, ‘redirecting_to_mobile_site’); function redirecting_to_mobile_site(){ if( wp_is_mobile() ){ wp_redirect( ‘http://m.example.com’, 301 ); exit; } }

Add custom post type name in term link?

Yes it is possible. For first it should be created new rewrite_rules compatible with WPML. This version add taxonomy slug to URL. (post_type/taxonomy/term) /** * Custom post type specific rewrite rules * @return wp_rewrite Rewrite rules handled by WordPress */ function cpt_rewrite_rules($wp_rewrite) { $rules = cpt_generate_archives(‘your_post_type_name’, $wp_rewrite); $wp_rewrite->rules = $rules + $wp_rewrite->rules; return $wp_rewrite; } … Read more

Login page is redirecting to homepage

Update your DOMAIN site. Put this in your wp-config.php file define(‘WP_HOME’,’http://example.com’); define(‘WP_SITEURL’,’http://example.com’); Probably thats fix your problem. Wherever, you can revert back to the Default Theme, renaming the folder of your current theme in /wp-content/themes/ directory. Trying too deleting your .htaccess file Regards.