當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Titles\title函數代碼示例

本文整理匯總了PHP中Roots\Sage\Titles\title函數的典型用法代碼示例。如果您正苦於以下問題:PHP title函數的具體用法?PHP title怎麽用?PHP title使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了title函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1:

      	<ul>
      		<li><a href="#">Link</a></li>
      		<li><a href="#">Blog</a></li>
      		<li><a href="#">Other</a></li>
      		<li><a href="#">Maria</a></li>
      	</ul>

        <div class="socialmedia">
          <ul>
            <li><a href="#"><img src="http://127.0.0.1/wordpress/wp-content/uploads/2015/12/socialmedia-011.png"/></a></li>
            <li><a href="#"><img src="http://127.0.0.1/wordpress/wp-content/uploads/2015/12/socialmedia-021.png"/></a></li>
            <li><a href="#"><img src="http://127.0.0.1/wordpress/wp-content/uploads/2015/12/socialmedia-031.png"/></a></li>
            <li><a href="#"><img src="http://127.0.0.1/wordpress/wp-content/uploads/2015/12/socialmedia-041.png"/></a></li>
            <li><a href="#"><img src="http://127.0.0.1/wordpress/wp-content/uploads/2015/12/socialmedia-051.png"/></a></li>
            <li><a href="#"><img src="http://127.0.0.1/wordpress/wp-content/uploads/2015/12/socialmedia-061.png"/></a></li>
          </ul>
        </div><!--ends .socialmedia-->
      </div><!--ends secondarynav-container-->
    </div><!--ends .secondarynav-->

    <div id="redline2"><p> </p>
    </div><!--ends .redline2-->

  
  <h1><?php 
echo Titles\title();
?>
</h1>
</div><!--ends page-header-->

開發者ID:msoroeta,項目名稱:theme-name,代碼行數:29,代碼來源:blog-header.php

示例2: elseif

<?php

use Roots\Sage\Titles;
?>

<?php 
if (has_post_thumbnail() && !is_archive() && !is_home()) {
    $thumb_id = get_post_thumbnail_id();
    $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'large', true);
    $thumb_url = $thumb_url_array[0];
    $header_type = 'hero';
    $bg_size = 'cover';
    $scroll_reveal = 'scroll-reveal';
} elseif (get_post_meta($post->ID, 'hero', true) == 1) {
    $thumb_url = get_theme_mod('site_image');
    $header_type = 'hero';
    $bg_size = 'cover';
    $scroll_reveal = 'scroll-reveal';
} else {
    $header_type = 'no-hero';
    $scroll_reveal = null;
    $thumb_url = null;
    $bg_size = null;
}
echo '<div class="page-header ' . $header_type . '" data-parallax="scroll" data-image-src="' . $thumb_url . '"' . ' style="background-size: ' . $bg_size . '">';
echo '<div class="' . $scroll_reveal . '">';
echo '<h1 class="header">' . Titles\title() . '</h1>';
echo '</div>';
echo '</div>';
開發者ID:jeffsee55,項目名稱:ntbcapital.com,代碼行數:29,代碼來源:page-header.php

示例3:

                            <?php 
            $parentTitle = get_the_title($parentPage) == '' ? '...' : get_the_title($parentPage);
            ?>
                            <a href="<?php 
            echo get_permalink($parentPage);
            ?>
"><?php 
            echo $parentTitle;
            ?>
</a>
                        </li>
                    <?php 
        }
        ?>
                    <li class="active"><?php 
        echo get_the_title();
        ?>
</li>
                </ol>

            </div>
        <?php 
    }
    ?>
        <h1><?php 
    echo esc_html(Titles\title());
    ?>
</h1>
    </div>
<?php 
}
開發者ID:sinaru,項目名稱:Sonder-WordPress-Theme,代碼行數:31,代碼來源:page-header.php

示例4:

<?php use Roots\Sage\Titles; ?>

<div class="page-header">
  <!-- <h1><?= Titles\title(); ?></h1> -->
</div>
開發者ID:RechadS,項目名稱:rtm,代碼行數:5,代碼來源:page-header.php

示例5: isset

<?php

use Roots\Sage\Titles;
/**
 * 		Homepage Slider
 * // javascript in _main.js 
 */
global $wp_query, $post, $panel_error_message;
global $meta;
?>

<?php 
$postId = get_the_ID();
$meta = get_post_custom($postId);
//in de footer extra enfotmatie over de rest van de onderneming
$extra_title = isset($meta['wpcf-extra-titel'][0]) ? $meta['wpcf-extra-titel'][0] : Titles\title();
$extra_content = isset($meta['wpcf-features-extra-regel-tekst'][0]) ? $meta['wpcf-features-extra-regel-tekst'][0] : "";
if (has_post_thumbnail()) {
    $HeaderImage = wp_get_attachment_url(get_post_thumbnail_id($post->ID));
} else {
    $HeaderImage = get_template_directory_uri() . '/dist/images/default_header.jpg';
}
?>

<div class="header-holder">
			
	<div id="imageHeader" class="imageHeader" style="background-image: url(<?php 
echo $HeaderImage;
?>
); ">
		<div class="container"> 
開發者ID:hphioolen,項目名稱:grimex_theme,代碼行數:31,代碼來源:featured-image.php

示例6:

<?php

use Roots\Sage\Titles;
?>

<div class="page-header">
  <h1><?php 
echo Titles\title() . '<br><small>' . get_post_meta($post->ID, 'subtitle', true) . '</small>';
?>
</h1>
</div>
開發者ID:jbradach,項目名稱:materialboot,代碼行數:11,代碼來源:page-header.php


注:本文中的Roots\Sage\Titles\title函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。