$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>How to show theme on front end before sign up for multisite|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

How to show theme on front end before sign up for multisite

matteradmin8PV0评论

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
 |  Show 3 more comments

1 Answer 1

Reset to default 0

Use 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>';
}
Post a comment

comment list (0)

  1. No comments so far