I am working on new project which based on Wordpress Multisite I have done with the wp multisite set up and site creation functionality from front end. now what I need to do is to show the theme at front end to user and user will select the theme and after the theme select user will sign up and the new site is created with the theme active which the user select. Please provide and suggestion
I am working on new project which based on Wordpress Multisite I have done with the wp multisite set up and site creation functionality from front end. now what I need to do is to show the theme at front end to user and user will select the theme and after the theme select user will sign up and the new site is created with the theme active which the user select. Please provide and suggestion
Share Improve this question asked Oct 17, 2018 at 6:05 SandipSandip 132 bronze badges 8- Can some one ans my question. You are welcome in advance. – Sandip Commented Oct 17, 2018 at 6:27
- Hi. Well yes, it can be done. You can use the hooks signup_blogform and wpmu_validate_blog_signup to add for example radio buttons on blog signup to choose from the themes. You can get the themes with wp_get_themes(). And you can show their screenshots, with the WP_Theme::get_screenshot() method. – Nikolay Commented Oct 17, 2018 at 7:39
- What have you tried already? Show us your efforts. – Max Yudin Commented Oct 17, 2018 at 7:46
- Hello Max I am doing it in first time so I have no idea about it I was looking for some plugins but did not get any so that I am trying it by hooks can you provide me any example. – Sandip Commented Oct 17, 2018 at 9:48
- Hi Nikolay can you provide me proper code for this if possible thanks in advance! – Sandip Commented Oct 17, 2018 at 9:54
1 Answer
Reset to default 0Use below code to get the theme screen shot and theme name at front end for multi-site sign-up page.
$themes = wp_get_themes();
foreach( $themes as $theme ){
echo '<b>Theme Name: </b>' . $theme -> name;
echo '<div class="area"><img src="' . esc_url($theme->get_screenshot()) . '" /> </div>';
}