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


PHP wp_head函数代码示例

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


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

示例1: get_head_template

function get_head_template()
{
    ?>
<head>
    <meta charset="UTF-8">
    <title>KENYANKE</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <link rel="stylesheet" type="text/css" href="<?php 
    echo get_template_directory_uri();
    ?>
/sanitize.css">
    <link rel="stylesheet" type="text/css" href="<?php 
    echo get_template_directory_uri();
    ?>
/style.css">
    <!-- Analytics -->
    <script>
      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
      })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

      ga('create', 'UA-67612178-1', 'auto');
      ga('send', 'pageview');

    </script>
    <?php 
    wp_head();
    ?>
</head>

<?php 
}
开发者ID:kenyakodaira,项目名称:kenyanke,代码行数:34,代码来源:template-head.php

示例2: wcng_email_header

/**
 * Email header for hooking scripts and stylesheet for admin
 * 
 * @return void
 */
function wcng_email_header()
{
    if (wcng_current_user_can_edit_newsletter()) {
        wp_head();
    }
    do_action('wcng_email_header');
}
开发者ID:gregoriopellegrino,项目名称:woocommerce-newsletter-generator,代码行数:12,代码来源:functions-wc-newsletter-generator-template-tags.php

示例3: wordpressAction

 public function wordpressAction(Request $request)
 {
     $this->get('wordpress.loader')->load();
     $this->get('wordpress.loader')->loadPostInWordpressFromRequest($request);
     remove_theme_support('custom-header');
     remove_action('wp_head', 'wp_enqueue_scripts', 1);
     remove_action('wp_head', 'feed_links', 2);
     remove_action('wp_head', 'feed_links_extra', 3);
     remove_action('wp_head', 'rsd_link');
     remove_action('wp_head', 'wlwmanifest_link');
     remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
     remove_action('wp_head', 'locale_stylesheet');
     remove_action('wp_head', 'noindex', 1);
     remove_action('wp_head', 'wp_print_styles', 8);
     remove_action('wp_head', 'wp_print_head_scripts', 9);
     remove_action('wp_head', 'wp_generator');
     remove_action('wp_head', 'rel_canonical');
     remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);
     ob_start();
     @wp_head();
     $head = ob_get_clean();
     ob_start();
     $content = dynamic_sidebar('sidebar-2');
     $side = ob_get_clean();
     ob_start();
     the_content();
     $content = ob_get_clean();
     $post = array('content' => $content);
     return $this->render($this->container->getParameter('wordpress.template'), array('post' => $post));
 }
开发者ID:cmoncy,项目名称:WordpressBundle,代码行数:30,代码来源:DefaultController.php

示例4: get_rendered_item

 function get_rendered_item()
 {
     $item_id = explode('-', $_REQUEST['id']);
     if (count($item_id) == 2) {
         global $wp_query;
         query_posts('page_id=' . $item_id[0]);
         query_posts(array('p' => $item_id[0], 'post_type' => $item_id[1]));
         ob_start();
         wp_head();
         $header = ob_get_contents();
         ob_end_clean();
         ob_start();
         include RHC_PATH . 'templates/calendar-single-post.php';
         $content = ob_get_contents();
         ob_end_clean();
         ob_start();
         wp_footer();
         $footer = ob_get_contents();
         ob_end_clean();
         $response = (object) array('R' => 'OK', 'MSG' => '', 'DATA' => array('body' => $content, 'footer' => $footer));
         die(json_encode($response));
     } else {
         die(json_encode(array('R' => 'ERR', 'MSG' => __('Invalid item id', 'rhc'))));
     }
 }
开发者ID:TheMysticalSock,项目名称:westmichigansymphony,代码行数:25,代码来源:class.calendar_ajax.php

示例5: hw_ajax_before_content

/**
 * do before show content ajax
 */
function hw_ajax_before_content()
{
    $allow_head = isset($_REQUEST['include_head']) && $_REQUEST['include_head'] ? true : false;
    //call wp_head()
    if ($allow_head) {
        wp_head();
    }
}
开发者ID:hoangsoft90,项目名称:hw-hoangweb-plugin,代码行数:11,代码来源:ajax.php

示例6: wp_head

 public function wp_head()
 {
     if (is_singular() && get_option('thread_comments')) {
         wp_enqueue_script("comment-reply");
     }
     wp_head();
     do_action("pe_theme_wp_head");
 }
开发者ID:JeffreyBue,项目名称:jb,代码行数:8,代码来源:PeThemeHeader.php

示例7: renderPage

 public function renderPage($templateName, $templateVars = false)
 {
     echo $this->render('header', ChesterWPCoreDataHelpers::getBlogInfoData());
     wp_head();
     echo $this->render('header_close', array('siteTitleHTML' => self::renderSiteTitle()));
     echo $this->render($templateName, $templateVars);
     wp_footer();
     echo $this->render('footer');
 }
开发者ID:zakirsajib,项目名称:Chester-WordPress-MVC-Theme-Framework,代码行数:9,代码来源:base_controller.php

示例8: test_json_url_is_passed

 /**
  * Test that the emoji.json URL is passed.
  */
 function test_json_url_is_passed()
 {
     $post_id = $this->factory->post->create();
     $this->go_to(get_permalink($post_id));
     ob_start();
     wp_head();
     $head = ob_get_clean();
     $this->assertEquals(1, preg_match("/emoji_url: '[^']*emoji.json'/", $head));
 }
开发者ID:pento,项目名称:react,代码行数:12,代码来源:test-frontend.php

示例9: get_header

 public function get_header()
 {
     // get the closing tag of the html head
     $pos = strpos($this->_header, '</head>');
     // echo the header and 'inject' the wp_head hook
     echo substr($this->_header, 0, $pos);
     wp_head();
     echo substr($this->_header, $pos);
 }
开发者ID:vrtulka23,项目名称:daiquiri,代码行数:9,代码来源:functions.php

示例10: wptouch_head

function wptouch_head()
{
    if (is_single()) {
        add_action('wp_head', 'wptouch_canonical_link');
        remove_action('wp_head', 'rel_canonical');
    }
    do_action('wptouch_pre_head');
    wp_head();
    do_action('wptouch_post_head');
}
开发者ID:uwmadisoncals,项目名称:Cluster-Plugins,代码行数:10,代码来源:theme.php

示例11: tna_wp_head

function tna_wp_head()
{
    ob_start();
    wp_head();
    $wp_head = ob_get_contents();
    ob_end_clean();
    global $pre_path;
    $wp_head = str_replace(site_url(), 'http://www.nationalarchives.gov.uk' . $pre_path, $wp_head);
    echo $wp_head;
}
开发者ID:nationalarchives,项目名称:tna-base,代码行数:10,代码来源:url-rewriting.php

示例12: clink_page_generator

    /**
     * Generate Clink countdown page when is needed 
     */
    function clink_page_generator()
    {
        global $clink_url;
        global $post_id;
        $clink_powered_by_text = get_option('clink_powered_by_text');
        $clink_countdown_duration = get_option('clink_countdown_duration');
        if (!is_numeric($clink_countdown_duration) or empty($clink_countdown_duration)) {
            $clink_countdown_duration = 10;
        }
        ?>
		<!DOCTYPE html>
		<html>
			<head>
				<?php 
        echo '<title>' . get_the_title($post_id) . ' - ' . get_bloginfo('name') . '</title>';
        echo '<meta name="robots" content="noindex,nofollow"/>';
        wp_head();
        echo "<script>\n\t\t\t\t\t\tvar countdown_duration =" . $clink_countdown_duration . ";\n\t\t\t\t\t\tvar redirect_target_url ='" . $clink_url . "';\t\t\t\t\t\t\n\t\t\t\t\t</script>";
        ?>
			</head>
			<body <?php 
        body_class(get_bloginfo('language'));
        ?>
 <?php 
        if (is_rtl()) {
            echo 'dir="rtl"';
        }
        ?>
> 
				<div class="clink-page">
					<div class="container">
						<div class="clink-box">
							<p><?php 
        _e('You will redirect to the destination link In a moment', 'aryan-themes');
        ?>
</p>
							<div id="countdown"></div>
							<p class="problem"><?php 
        printf(__('If the page does not redirect automatically, click on <a href="%s">this link</a>', 'aryan-themes'), $clink_url);
        ?>
</p>
						</div>
					</div>
					<?php 
        if ($clink_powered_by_text === "1") {
            echo '<div class="aryan-themes"><p>';
            printf(__('Powered By <a href="%s">Aryan Themes</a>', 'aryan-themes'), 'http://aryanthemes.com');
            echo '</p></div>';
        }
        ?>
				</div>
			</body>
		</html>
	<?php 
    }
开发者ID:aryanthemes,项目名称:Clink,代码行数:58,代码来源:clink-template.php

示例13: wptouch_core_header_enqueue

function wptouch_core_header_enqueue()
{
    $version = get_bloginfo('version');
    if (!bnc_wptouch_is_exclusive()) {
        wp_enqueue_script('wptouch-core', '' . compat_get_plugin_url('wptouch') . '/themes/core/core.js', array('jquery'), '1.9');
        wp_head();
    } elseif (bnc_wptouch_is_exclusive()) {
        echo "<script src='" . get_bloginfo('wpurl') . "/wp-includes/js/jquery/jquery.js' type='text/javascript' charset='utf-8'></script>\n";
        echo "<script src='" . compat_get_plugin_url('wptouch') . "/themes/core/core.js' type='text/javascript' charset='utf-8'></script>\n";
    }
}
开发者ID:emelleme,项目名称:Drexel-Cab,代码行数:11,代码来源:core-functions.php

示例14: dite_zoom_shortcode

function dite_zoom_shortcode($arg)
{
    global $wpdb, $post;
    wp_enqueue_script('jquery');
    wp_deregister_script('jquery-zoom');
    wp_enqueue_script('jquery-zoom', dite_zoom_pluginurl('js') . '/jquery.jqzoom-core.js');
    wp_enqueue_style('jquery-zoom', dite_zoom_pluginurl('css') . '/jquery.jqzoom.css');
    wp_head();
    $id = $arg['id'];
    include_once dite_zoom_pluginpath() . '/views/shortcode.php';
}
开发者ID:johntcook,项目名称:zoom-images,代码行数:11,代码来源:shortcode.php

示例15: renderPage

 /**
  * Print head + template + footer
  *
  * @param string $templateName Template name to print
  * @param array $templateVars Parameters to template
  */
 public function renderPage($templateName, $templateVars = [])
 {
     // HEAD
     ob_start();
     wp_head();
     $wpHead = ob_get_clean();
     // FOOTER
     ob_start();
     wp_footer();
     $wpFooter = ob_get_clean();
     return $this->render($templateName, array_merge($templateVars, ['wp_head' => $wpHead, 'wp_footer' => $wpFooter]));
 }
开发者ID:chemaclass,项目名称:knob-base,代码行数:18,代码来源:BaseController.php


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