當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。