The MU forums have moved to WordPress.org

php call to have available themes show up on a page (4 posts)

  1. sskhalsa
    Member
    Posted 18 years ago #

    what php function would we use to call the available php themes to a page? I want to show my users what templates are installed, and it would be much easier for alot of people if it would auto update directly with some php function.

    I have looked at themes.php in the wpmu admin folder, but my php knowledge is very little.

    It looks like its somewhere here :

    <?php
    $themes = get_themes();
    $ct = current_theme_info();
    $allowed_themes = get_site_option( "allowed_themes" );
    if( $allowed_themes == false ) {
    $allowed_themes = $themes;
    }
    $blog_allowed_themes = get_option( "allowed_themes" );

    if( is_array( $blog_allowed_themes ) )
    $allowed_themes = array_merge( $allowed_themes, $blog_allowed_themes );

    if( isset( $allowed_themes[ $ct->title ] ) == false ) {
    $allowed_themes[ $ct->title ] = true;
    }
    reset( $themes );
    while( list( $key, $val ) = each( $themes ) ) {
    if( isset( $allowed_themes[ $key ] ) == false ) {
    unset( $themes[ $key ] );
    }
    }
    reset( $themes );
    ?>

    or here:

    <?php
    $style = '';

    $theme_names = array_keys($themes);
    natcasesort($theme_names);

    foreach ($theme_names as $theme_name) {
    if ( $theme_name == $current_theme )
    continue;
    $template = $themes[$theme_name]['Template'];
    $stylesheet = $themes[$theme_name]['Stylesheet'];
    $title = $themes[$theme_name]['Title'];
    $version = $themes[$theme_name]['Version'];
    $description = $themes[$theme_name]['Description'];
    $author = $themes[$theme_name]['Author'];
    $screenshot = $themes[$theme_name]['Screenshot'];
    $stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
    $activate_link = "themes.php?action=activate&amp;template=$template&amp;stylesheet=$stylesheet";
    ?>

  2. techwench
    Inactive
    Posted 18 years ago #

    After you upload a theme, you have to make it available to everyone by going into Site Admin >> Themes.

    Once you make it available, it will automatically show up in the themes.php page.

  3. sskhalsa
    Member
    Posted 18 years ago #

    thx for quick reply

    but, i meant if i wanna display available themes to people who aren't signed up yet

  4. sskhalsa
    Member
    Posted 18 years ago #

    how are others showing their available templates to non registered users? Making a table? :(

About this Topic

  • Started 18 years ago by sskhalsa
  • Latest reply from sskhalsa