当前位置: 首页>>代码示例>>PHP>>正文


PHP get_theme函数代码示例

本文整理汇总了PHP中get_theme函数的典型用法代码示例。如果您正苦于以下问题:PHP get_theme函数的具体用法?PHP get_theme怎么用?PHP get_theme使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_theme函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: jetpack_load_infinite_scroll_annotation

/**
* Load theme's infinite scroll annotation file, if present in the IS plugin.
* The `setup_theme` action is used because the annotation files should be using `after_setup_theme` to register support for IS.
*
* As released in Jetpack 2.0, a child theme's parent wasn't checked for in the plugin's bundled support, hence the convoluted way the parent is checked for now.
*
* @uses is_admin, wp_get_theme, get_theme, get_current_theme, apply_filters
* @action setup_theme
* @return null
*/
function jetpack_load_infinite_scroll_annotation()
{
    if (is_admin() && isset($_GET['page']) && 'jetpack' == $_GET['page']) {
        $theme = function_exists('wp_get_theme') ? wp_get_theme() : get_theme(get_current_theme());
        if (!is_a($theme, 'WP_Theme') && !is_array($theme)) {
            return;
        }
        /**
         * Filter the directory where all Infinite Scroll compat files are located.
         *
         * @since 2.0.0
         *
         * @param string $var Infinite Scroll compat file URL.
         * @param string $theme['Stylesheet'] Theme directory URI.
         */
        $customization_file = apply_filters('infinite_scroll_customization_file', dirname(__FILE__) . "/infinite-scroll/themes/{$theme['Stylesheet']}.php", $theme['Stylesheet']);
        if (is_readable($customization_file)) {
            require_once $customization_file;
        } elseif (!empty($theme['Template'])) {
            $customization_file = dirname(__FILE__) . "/infinite-scroll/themes/{$theme['Template']}.php";
            if (is_readable($customization_file)) {
                require_once $customization_file;
            }
        }
    }
}
开发者ID:tinggao,项目名称:woofWarrior,代码行数:36,代码来源:infinite-scroll.php

示例2: test_theme_sandbox

	/**
	 * @expectedDeprecated get_theme
	 * @expectedDeprecated get_themes
	 */
	function test_theme_sandbox() {
		$theme = get_theme('Sandbox');

		$this->assertFalse( empty($theme) );

		#echo gen_tests_array('theme', $theme);

		$this->assertEquals( 'Sandbox', $theme['Name'] );
		$this->assertEquals( 'Sandbox', $theme['Title'] );
		$this->assertEquals( 'A theme with powerful, semantic CSS selectors and the ability to add new skins.', $theme['Description'] );
		$this->assertEquals( '<a href="http://andy.wordpress.com/">Andy Skelton</a> &amp; <a href="http://www.plaintxt.org/">Scott Allan Wallick</a>', $theme['Author'] );
		$this->assertEquals( '0.6.1-wpcom', $theme['Version'] );
		$this->assertEquals( 'sandbox', $theme['Template'] );
		$this->assertEquals( 'sandbox', $theme['Stylesheet'] );

		$template_files = $theme['Template Files'];

		$this->assertEquals( $this->theme_root.'/sandbox/functions.php', reset( $template_files ) );
		$this->assertEquals( $this->theme_root.'/sandbox/index.php', next( $template_files ) );

		$stylesheet_files = $theme['Stylesheet Files'];

		$this->assertEquals( $this->theme_root.'/sandbox/style.css', reset( $stylesheet_files ) );

		$this->assertEquals( $this->theme_root.'/sandbox', $theme['Template Dir'] );
		$this->assertEquals( $this->theme_root.'/sandbox', $theme['Stylesheet Dir'] );
		$this->assertEquals( 'publish', $theme['Status'] );
		$this->assertEquals( '', $theme['Parent Theme'] );

	}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:34,代码来源:themeDir.php

示例3: w3tc_get_current_theme

function w3tc_get_current_theme()
{
    global $wp_version;
    if (version_compare($wp_version, '3.4', '>=')) {
        return wp_get_theme();
    }
    return get_theme(get_current_theme());
}
开发者ID:easinewe,项目名称:Avec2016,代码行数:8,代码来源:compat.php

示例4: test_get_theme

	/**
	 * @expectedDeprecated get_theme
	 * @expectedDeprecated get_themes
	 */
	function test_get_theme() {
		$themes = get_themes();
		foreach (array_keys($themes) as $name) {
			$theme = get_theme($name);
			// WP_Theme implements ArrayAccess. Even ArrayObject returns false for is_array().
			$this->assertFalse( is_array( $theme ) );
			$this->assertInstanceOf( 'WP_Theme', $theme );
			$this->assertEquals($theme, $themes[$name]);
		}
	}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:14,代码来源:theme.php

示例5: xpress_ThemeTemplate

function xpress_ThemeTemplate($template)
{
    global $xpress_config;
    $theme = $xpress_config->theme_select;
    $theme = get_theme($theme);
    if (empty($theme)) {
        return $template;
    }
    return $theme['Template'];
}
开发者ID:nouphet,项目名称:rata,代码行数:10,代码来源:xpressme.php

示例6: menuimg

 function menuimg($gfile)
 {
     $ThemeSel = get_theme();
     if (file_exists("themes/{$ThemeSel}/images/menu/{$gfile}")) {
         $menuimg = "themes/{$ThemeSel}/images/menu/{$gfile}";
     } else {
         $menuimg = "modules/Your_Account/images/{$gfile}";
     }
     return $menuimg;
 }
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:10,代码来源:navbar.php

示例7: test_page_templates

 /**
  * @ticket 10959
  * @ticket 11216
  * @expectedDeprecated get_theme
  * @expectedDeprecated get_themes
  */
 function test_page_templates()
 {
     $theme = get_theme('Page Template Theme');
     $this->assertNotEmpty($theme);
     switch_theme($theme['Template'], $theme['Stylesheet']);
     $this->assertEqualSetsWithIndex(array('Top Level' => 'template-top-level.php', 'Sub Dir' => 'subdir/template-sub-dir.php', 'This Template Header Is On One Line' => 'template-header.php'), get_page_templates());
     $theme = wp_get_theme('page-templates');
     $this->assertNotEmpty($theme);
     switch_theme($theme['Template'], $theme['Stylesheet']);
     $this->assertEqualSetsWithIndex(array('Top Level' => 'template-top-level.php', 'Sub Dir' => 'subdir/template-sub-dir.php', 'This Template Header Is On One Line' => 'template-header.php'), get_page_templates());
 }
开发者ID:aaemnnosttv,项目名称:develop.git.wordpress.org,代码行数:17,代码来源:includesTheme.php

示例8: test_page_templates

 /**
  * @ticket 10959
  * @ticket 11216
  */
 function test_page_templates()
 {
     $theme = get_theme('Page Template Theme');
     $this->assertFalse(empty($theme));
     switch_theme($theme['Template'], $theme['Stylesheet']);
     $templates = get_page_templates();
     $this->assertEquals(3, count($templates));
     $this->assertEquals("template-top-level.php", $templates['Top Level']);
     $this->assertEquals("subdir/template-sub-dir.php", $templates['Sub Dir']);
     $this->assertEquals("template-header.php", $templates['This Template Header Is On One Line']);
 }
开发者ID:rmccue,项目名称:wordpress-unit-tests,代码行数:15,代码来源:includesTheme.php

示例9: get_template

 function get_template($template)
 {
     $theme = $this->get_theme();
     if (empty($theme)) {
         return $template;
     }
     $theme = get_theme($theme);
     if (empty($theme)) {
         return $template;
     }
     // Don't let people peek at unpublished themes.
     if (isset($theme['Status']) && $theme['Status'] != 'publish') {
         return $template;
     }
     return $theme['Template'];
 }
开发者ID:s-diez,项目名称:TOXID-cURL,代码行数:16,代码来源:theme-switcher.php

示例10: menu

function menu($mainlink)
{
    global $module_name;
    OpenTable();
    $ThemeSel = get_theme();
    if (file_exists("themes/{$ThemeSel}/images/link-logo.gif")) {
        echo "<br><center><a href=\"modules.php?name={$module_name}\"><img src=\"themes/{$ThemeSel}/images/link-logo.gif\" border=\"0\" alt=\"\"></a><br><br>";
    } else {
        echo "<br><center><a href=\"modules.php?name={$module_name}\"><img src=\"modules/{$module_name}/images/link-logo.gif\" border=\"0\" alt=\"\"></a><br><br>";
    }
    echo "<form action=\"modules.php?name={$module_name}&amp;l_op=search&amp;query={$query}\" method=\"post\">" . "<font class=\"content\"><input type=\"text\" size=\"25\" name=\"query\"> <input type=\"submit\" value=\"" . _SEARCH . "\"></font>" . "</form>";
    echo "<font class=\"content\">[ ";
    if ($mainlink > 0) {
        echo "<a href=\"modules.php?name={$module_name}\">" . _LINKSMAIN . "</a> | ";
    }
    echo "<a href=\"modules.php?name={$module_name}&amp;l_op=AddLink\">" . _ADDLINK . "</a>" . " | <a href=\"modules.php?name={$module_name}&amp;l_op=NewLinks\">" . _NEW . "</a>" . " | <a href=\"modules.php?name={$module_name}&amp;l_op=MostPopular\">" . _POPULAR . "</a>" . " | <a href=\"modules.php?name={$module_name}&amp;l_op=TopRated\">" . _TOPRATED . "</a>" . " | <a href=\"modules.php?name={$module_name}&amp;l_op=RandomLink\">" . _RANDOM . "</a> ]" . "</font></center>";
    CloseTable();
}
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:18,代码来源:index.php

示例11: SERVICE_CMSCSS_cpgnuke

function SERVICE_CMSCSS_cpgnuke()
{
    global $include_path, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $thename, $cms_mode, $css, $row_colors, $jz_MenuItem, $jz_MenuItemHover, $jz_MenuItemLeft, $jz_MainItemHover, $jz_MenuSplit;
    echo "<style type=\"text/css\">" . ".jz_row1 { background-color:{$bgcolor1}; }" . ".jz_row2 { background-color:{$bgcolor2}; }" . ".and_head1 { background-color:{$bgcolor2}; }" . ".and_head2 { background-color:{$bgcolor1}; }" . "</style>";
    // Now let's set the style sheet for CMS stuff
    $thename = @get_theme();
    $_SESSION['cms-style'] = "themes/" . $thename . "/style/style.css";
    $_SESSION['cms-theme-data'] = urlencode($bgcolor1 . "|" . $bgcolor2);
    $row_colors = array('jz_row2', 'jz_row1');
    $jz_MenuItemHover = "jz_row2";
    $jz_MenuItem = "jz_row1";
    $jz_MenuItemLeft = "jzMenuItemLeft";
    $jz_MenuSplit = "jzMenuSplit";
    $jz_MainItemHover = "jzMainItemHover";
    // Now let's set the CSS
    $css = $include_path . "style/cms-theme/default.php";
    return $css;
}
开发者ID:seanfbrown,项目名称:jinzora,代码行数:18,代码来源:cpgnuke.php

示例12: jetpack_load_infinite_scroll_annotation

/**
 * Load theme's infinite scroll annotation file, if present in the IS plugin.
 * The `setup_theme` action is used because the annotation files should be using `after_setup_theme` to register support for IS.
 *
 * As released in Jetpack 2.0, a child theme's parent wasn't checked for in the plugin's bundled support, hence the convoluted way the parent is checked for now.
 *
 * @uses is_admin, wp_get_theme, get_theme, get_current_theme, apply_filters
 * @action setup_theme
 * @return null
 */
function jetpack_load_infinite_scroll_annotation()
{
    if (is_admin() && isset($_GET['page']) && 'jetpack' == $_GET['page']) {
        $theme = function_exists('wp_get_theme') ? wp_get_theme() : get_theme(get_current_theme());
        if (!is_a($theme, 'WP_Theme') && !is_array($theme)) {
            return;
        }
        $customization_file = apply_filters('infinite_scroll_customization_file', dirname(__FILE__) . "/infinite-scroll/themes/{$theme['Stylesheet']}.php", $theme['Stylesheet']);
        if (is_readable($customization_file)) {
            require_once $customization_file;
        } elseif (!empty($theme['Template'])) {
            $customization_file = dirname(__FILE__) . "/infinite-scroll/themes/{$theme['Template']}.php";
            if (is_readable($customization_file)) {
                require_once $customization_file;
            }
        }
    }
}
开发者ID:burbridge,项目名称:thesis2013website,代码行数:28,代码来源:module-extras.php

示例13: head

function head()
{
    global $slogan, $sitename, $banners, $nukeurl, $Version_Num, $artpage, $topic, $hlpfile, $user, $hr, $theme, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $forumpage, $adminpage, $userpage, $pagetitle;
    $ThemeSel = get_theme();
    include "themes/{$ThemeSel}/theme.php";
    echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
    echo "<html>\n";
    echo "<head>\n";
    echo "<title>{$sitename} {$pagetitle}</title>\n";
    include "includes/meta.php";
    include "includes/javascript.php";
    if (file_exists("themes/{$ThemeSel}/images/favicon.ico")) {
        echo "<link REL=\"shortcut icon\" HREF=\"themes/{$ThemeSel}/images/favicon.ico\" TYPE=\"image/x-icon\">\n";
    }
    echo "<LINK REL=\"StyleSheet\" HREF=\"themes/{$ThemeSel}/style/style.css\" TYPE=\"text/css\">\n\n\n";
    include "includes/my_header.php";
    echo "\n\n\n</head>\n\n";
    themeheader();
}
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:19,代码来源:header.php

示例14: downl_menu_tpl

function downl_menu_tpl($maindownload)
{
    global $user_adddownload, $module_name;
    OpenTable();
    $ThemeSel = get_theme();
    if (file_exists("themes/{$ThemeSel}/images/down-logo.gif")) {
        echo "<br /><div align=\"center\"><a href=\"" . getlink() . "\"><img src=\"themes/{$ThemeSel}/images/down-logo.gif\" border=\"0\" alt=\"\" /></a><br /><br />";
    } else {
        echo "<br /><div align=\"center\"><a href=\"" . getlink() . "\"><img src=\"modules/{$module_name}/images/down-logo.gif\" border=\"0\" alt=\"\" /></a><br /><br />";
    }
    echo "<form action=\"" . getlink("&amp;d_op=search") . "\" method=\"post\"><input type=\"text\" size=\"25\" name=\"query\" /> <input type=\"submit\" value=\"" . _SEARCH . "\" /></form>" . "<font class=\"content\">[ ";
    if ($maindownload > 0) {
        echo "<a href=\"" . getlink() . "\">" . _DOWNLOADSMAIN . "</a> | ";
    }
    if ($user_adddownload) {
        echo "<a href=\"" . getlink("&amp;d_op=AddDownload") . "\">" . _ADDDOWNLOAD . "</a> | ";
    }
    echo "<a href=\"" . getlink("&amp;d_op=NewDownloads") . "\">" . _NEW . "</a>" . " | <a href=\"" . getlink("&amp;d_op=MostPopular") . "\">" . _POPULAR . "</a>" . " | <a href=\"" . getlink("&amp;d_op=TopRated") . "\">" . _TOPRATED . "</a> ]" . "</font></div>";
    CloseTable();
}
开发者ID:cbsistem,项目名称:nexos,代码行数:20,代码来源:theme.php

示例15: get_themes

/**
 * get_themes
 * this looks in /themes and pulls all of the
 * theme.cfg.php files it can find and returns an
 * array of the results
 */
function get_themes()
{
    /* Open the themes dir and start reading it */
    $handle = opendir(AmpConfig::get('prefix') . '/themes');
    if (!is_resource($handle)) {
        debug_event('theme', 'Failed to open /themes directory', 2);
        return array();
    }
    $results = array();
    while (($f = readdir($handle)) !== false) {
        debug_event('theme', "Checking {$f}", 5);
        $cfg = get_theme($f);
        if ($cfg !== null) {
            $results[$cfg['name']] = $cfg;
        }
    }
    // end while directory
    // Sort by the theme name
    ksort($results);
    return $results;
}
开发者ID:cheese1,项目名称:ampache,代码行数:27,代码来源:themes.php


注:本文中的get_theme函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。