/** * Returns the version of the the current theme. * * @return string * The version of the current theme. * * @ingroup helperfunc */ function get_theme_version() { if (class_exists('WP_Theme')) { $theme = new WP_Theme(get_theme_name(), get_theme_root()); return $theme->get('Version'); } else { $theme_data = get_theme_data(get_template_directory() . '/style.css'); return $theme_data['Version']; } }
function is_theme_skipped($path) { $name = get_theme_name($path); $skipped_themes = \WP_CLI::get_runner()->config['skip-themes']; if (true === $skipped_themes) { return true; } if (!is_array($skipped_themes)) { $skipped_themes = explode(',', $skipped_themes); } return in_array($name, array_filter($skipped_themes)); }
function test_get_theme_name() { $this->assertEqual('mocked_theme', get_theme_name()); }
/** * Return image URl * * @param string $file_name * @return string */ function get_image_url($file_name) { static $theme = null; if (is_null($theme)) { if (function_exists('config_option')) { $theme = get_theme_name(); } // if if (trim($theme) == '') { $theme = DEFAULT_THEME; } // if } // if return get_public_url("assets/themes/$theme/images/$file_name"); } // get_image_url
<?php include 'common.php'; $current_page = basename($_SERVER['PHP_SELF']); $stylesheet = !empty($_COOKIE['themeName']) ? $_COOKIE['themeName'] : 'blue'; if ($logged_in) { $themeId = $user_info['themeId']; $stylesheet = get_theme_name($db, $themeId); } ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <link type="text/css" rel="stylesheet" href = "css/main.css"> <link id="currentCss" rel="stylesheet" href="css/<?php echo $stylesheet; ?> .css"> <title>Final Project</title> </head> <body> <nav class="nav"> <ul> <li class="left" id="logo"> <img src="icon.png" alt="Logo" style="width:35px;height:35px"/> </li> <?php $pages = ['Home' => 'index.php', 'About' => 'about.php', 'Profile' => 'profile.php', 'Source' => 'source.php']; if ($logged_in) {
/** * Returns the absolute path to the current theme. * * Path without trailing slash. * * @return string * The absolute path to the current theme. * * @ingroup helperfunc */ function get_theme_path() { return get_theme_root() . '/' . get_theme_name(); }
<tbody> <?php if ($row = mysql_fetch_assoc($this->result)): ?> <?php do { $parent_cat_name = ''; if ($row['cat_parent']) { // won't work $parent_cat_name = $this->row_cat['cat_name']; } ?> <tr onmousedown="document.form['m<?php echo $row['cat_id']; ?>'].checked = true; rowselect(this);" id="r_<?php echo $row['cat_id']; ?>"> <td width="10"><input type="radio" name="cat_id" value="<?php echo $row['cat_id']; ?>" id="m<?php echo $row['cat_id']; ?>" /></td> <td><label for="m<?php echo $row['cat_id']; ?>"><?php echo AT_print($row['cat_name'], 'course_cats.cat_name'); ?></label></td> <td><?php echo AT_print($parent_cat_name, 'course_cats.cat_name'); ?></td> <?php if (defined('AT_ENABLE_CATEGORY_THEMES') && AT_ENABLE_CATEGORY_THEMES) : ?> <td><?php echo AT_print(get_theme_name($row['theme']), 'themes.title'); ?></td> <?php endif; ?> </tr> <?php } while ($row = mysql_fetch_assoc($this->result)); ?> <?php else: ?> <tr> <td colspan="3"><?php echo _AT('none_found'); ?></td> </tr> <?php endif; ?> </tbody> </table> </form>
<a id="hideOptionsLink" class="hidden" href="javascript:hideOptions()"><?php echo lang('hide options'); ?></a></label></div> <div id="options1" class="hidden"> <ul> <li> <label for="loginLanguage"><?php echo lang('language'); ?></label><select name="loginLanguage" id="loginLanguage"> <option value="de_de">Deutsch</option> <option selected="selected" value="en_us">English (U.S.)</option> <option value="es_es">Español</option> <option value="fr_fr">Français</option> <option value="nl_nl">Nederlands</option> </select> </li> <li> <label for="loginTheme"><?php echo lang('theme'); ?></label><select name="loginTheme" id="loginTheme"> <?php foreach (get_available_themes() as $theme => $theme_name): ?> <option<?php if (get_theme_name() == $theme) echo ' selected="selected"'; ?> value="<?php echo $theme ?>"><?php echo $theme_name ?></option> <?php endforeach ?> </select> </li> </ul> </div> </div> <div class="right"> <div id="loginPasswordDiv"> <label for="loginPassword"><?php echo lang('password') ?>:</label> <?php echo password_field('login[password]', null, array('id' => 'loginPassword', 'class' => 'medium', 'tabindex' => 2)) ?> </div> <div id="loginSubmit"><?php echo submit_button(lang('login'), null, array('tabindex' => 3) ) ?></div> <div id="options2" class="hidden"> <ul> <li id="loginClearCookies"><a href="<?php echo get_url('access', 'clear_cookies') ?>"><?php echo lang('clear cookies') ?></a></li>
/** * Return layout * * @access public * @param string $layout * @return string */ static function getLayoutPath($layout) { $theme_name = get_theme_name(); $layout_path_theme = ROOT."/public/assets/themes/$theme_name/templates/layouts/$layout.php"; if (is_readable($layout_path_theme)) return $layout_path_theme; else return APPLICATION_PATH . "/layouts/$layout.php"; } // getLayoutPath
<td><label for="m<?php echo $category['cat_id']; ?> "><?php echo AT_print($category['cat_name'], 'course_cats.cat_name'); ?> </label></td> <td><?php echo AT_print($category['parent_cat_name'], 'course_cats.cat_name'); ?> </td> <?php if (defined('AT_ENABLE_CATEGORY_THEMES') && AT_ENABLE_CATEGORY_THEMES) { ?> <td><?php echo AT_print(get_theme_name($category['theme']), 'themes.title'); ?> </td> <?php } ?> </tr> <?php } // end of foreach } // end of else ?> </tbody> </table>