The MU forums have moved to

List available themes in main blog (4 posts)

  1. charlie_hun
    Posted 14 years ago #

    Can I list available theme (for users) in the main blog (in a Page eg.), like Dashboard > Theme?

  2. dsader
    Posted 14 years ago #

    Yes, but .... not without building your own page from scratch, I think.

    Couple steps, build the theme array, then style the output.

    Code in the wp-admin/themes.php will be how to build a proper themes array for WPMU.

    Look for code from line 15-36

    $themes = get_themes();
    reset( $themes );

    The code there has a limitation in that it does not cache the collected data, so you may want to add a "wp_cache_get" around the array to lessen the load each time the page is hit.(Note the major code differences with how WP generates themes array and how WPMU generates the array for wp-admin/themes.php)

    Once you have a proper WPMU themes array, hack that into a regular old WP theme showcase-type plugin (replacing $themes = get_themes(); with a more robust WPMU version)

    Here's an example plugin for WP that could do most of what you are after:

    Remember, WPMU has filters to the theme list available to users, WP plugins would likely list all themes - I wouldn't want that.

  3. andrea_r
    Posted 14 years ago #

    Dang, I thought I did a write up how to do this. :)

  4. charlie_hun
    Posted 14 years ago #

    Thnx dsader, I probe this solutions

About this Topic

  • Started 14 years ago by charlie_hun
  • Latest reply from charlie_hun