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


PHP ttfmake_get_view函数代码示例

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


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

示例1: ttfmake_maybe_add_with_avatar_class

 /**
  * Add a class to the bounding div if a post uses an avatar with the author byline.
  *
  * @since  1.0.11.
  *
  * @param  array     $classes    An array of post classes.
  * @param  string    $class      A comma-separated list of additional classes added to the post.
  * @param  int       $post_ID    The post ID.
  * @return array                 The modified post class array.
  */
 function ttfmake_maybe_add_with_avatar_class($classes, $class, $post_ID)
 {
     $author_key = 'layout-' . ttfmake_get_view() . '-post-author';
     $author_option = ttfmake_sanitize_choice(get_theme_mod($author_key, ttfmake_get_default($author_key)), $author_key);
     if ('avatar' === $author_option) {
         $classes[] = 'has-author-avatar';
     }
     return $classes;
 }
开发者ID:fovoc,项目名称:make,代码行数:19,代码来源:layout.php

示例2: ttfmake_maybe_show_site_region

/**
 * Output the site region (header or footer) markup if the current view calls for it.
 * ADD some hooks that I can use before and after
 *
 * @since  1.0.0.
 *
 * @param  string    $region    Region to maybe show.
 * @return void
 */
function ttfmake_maybe_show_site_region($region)
{
    if (!in_array($region, array('header', 'footer'))) {
        return;
    }
    // Get the view
    $view = ttfmake_get_view();
    // Get the relevant option
    $hide_region = (bool) get_theme_mod('layout-' . $view . '-hide-' . $region, ttfmake_get_default('layout-' . $view . '-hide-' . $region));
    do_action('ttfmake_before_' . $region, $hide_region);
    if (true !== $hide_region) {
        get_template_part('partials/' . $region . '-layout', get_theme_mod($region . '-layout', ttfmake_get_default($region . '-layout')));
    }
    do_action('ttfmake_after_' . $region, $hide_region);
}
开发者ID:helgatheviking,项目名称:criticalink,代码行数:24,代码来源:functions.php

示例3: ttfmake_jetpack_infinite_scroll_has_footer_widgets

 /**
  * Determine whether any footer widgets are actually showing.
  *
  * @since  1.0.0.
  *
  * @return bool    Whether or not infinite scroll has footer widgets.
  */
 function ttfmake_jetpack_infinite_scroll_has_footer_widgets()
 {
     // Get the view
     $view = ttfmake_get_view();
     // Get the relevant options
     $hide_footer = (bool) get_theme_mod('layout-' . $view . '-hide-footer', ttfmake_get_default('layout-' . $view . '-hide-footer'));
     $widget_areas = (int) get_theme_mod('footer-widget-areas', ttfmake_get_default('footer-widget-areas'));
     // No widget areas are visible
     if (true === $hide_footer || $widget_areas < 1) {
         return false;
     }
     // Check for active widgets in visible widget areas
     $i = 1;
     while ($i <= $widget_areas) {
         if (is_active_sidebar('footer-' . $i)) {
             return true;
         }
         $i++;
     }
     // Still here? No footer widgets.
     return false;
 }
开发者ID:fovoc,项目名称:make,代码行数:29,代码来源:jetpack.php

示例4: ttfmake_get_view

<?php

/**
 * @package Make
 */
$thumb_key = 'layout-' . ttfmake_get_view() . '-featured-images';
$thumb_option = ttfmake_sanitize_choice(get_theme_mod($thumb_key, ttfmake_get_default($thumb_key)), $thumb_key);
// Header
ob_start();
get_template_part('partials/entry', 'meta-top');
get_template_part('partials/entry', 'sticky');
if ('post-header' === $thumb_option) {
    get_template_part('partials/entry', 'thumbnail');
}
get_template_part('partials/entry', 'title');
get_template_part('partials/entry', 'meta-before-content');
$entry_header = trim(ob_get_clean());
// Footer
ob_start();
get_template_part('partials/entry', 'meta-post-footer');
get_template_part('partials/entry', 'taxonomy');
get_template_part('partials/entry', 'sharing');
$entry_footer = trim(ob_get_clean());
?>

<article id="post-<?php 
the_ID();
?>
" <?php 
post_class();
?>
开发者ID:marceloroberto,项目名称:make,代码行数:31,代码来源:content-single.php

示例5: ttfmake_get_view

<?php

/**
 * @package Make
 */
global $ttfmake_current_location;
$author_layout_key = 'layout-' . ttfmake_get_view() . '-post-author-location';
$author_option = ttfmake_sanitize_choice(get_theme_mod($author_layout_key, ttfmake_get_default($author_layout_key)), $author_layout_key);
$date_layout_key = 'layout-' . ttfmake_get_view() . '-post-date-location';
$date_option = ttfmake_sanitize_choice(get_theme_mod($date_layout_key, ttfmake_get_default($date_layout_key)), $date_layout_key);
$comment_count_layout_key = 'layout-' . ttfmake_get_view() . '-comment-count-location';
$comment_count_option = ttfmake_sanitize_choice(get_theme_mod($comment_count_layout_key, ttfmake_get_default($comment_count_layout_key)), $comment_count_layout_key);
if ($ttfmake_current_location === $author_option) {
    get_template_part('partials/entry', 'author');
}
if ($ttfmake_current_location === $comment_count_option) {
    get_template_part('partials/entry', 'comment-count');
}
if ($ttfmake_current_location === $date_option) {
    get_template_part('partials/entry', 'date');
}
开发者ID:marceloroberto,项目名称:make,代码行数:21,代码来源:entry-meta.php

示例6: ttfmake_get_view

<?php

/**
 * @package Make
 */
$comment_count_key = 'layout-' . ttfmake_get_view() . '-comment-count';
$comment_count_option = ttfmake_sanitize_choice(get_theme_mod($comment_count_key, ttfmake_get_default($comment_count_key)), $comment_count_key);
?>

<?php 
if ('none' !== $comment_count_option) {
    ?>
	<div class="entry-comment-count">
	<?php 
    if ('icon' === $comment_count_option) {
        ?>
		<a href="<?php 
        comments_link();
        ?>
">
			<?php 
        comments_number('<span class="comment-count-icon zero">0</span>', '<span class="comment-count-icon one">1</span>', '<span class="comment-count-icon many">%</span>');
        ?>
		</a>
	<?php 
    } else {
        ?>
		<a href="<?php 
        comments_link();
        ?>
">
开发者ID:marceloroberto,项目名称:make,代码行数:31,代码来源:entry-comment-count.php

示例7: ttfmake_has_sidebar

 /**
  * Determine if the current view should show a sidebar in the given location.
  *
  * @since  1.0.0.
  *
  * @param  string    $location    The location to test for.
  * @return bool                   Whether or not the location has a sidebar.
  */
 function ttfmake_has_sidebar($location)
 {
     global $wp_registered_sidebars;
     // Validate the sidebar location
     if (!in_array('sidebar-' . $location, array_keys($wp_registered_sidebars))) {
         return false;
     }
     // Get the view
     $view = ttfmake_get_view();
     // Get the relevant option
     $show_sidebar = (bool) get_theme_mod('layout-' . $view . '-sidebar-' . $location, ttfmake_get_default('layout-' . $view . '-sidebar-' . $location));
     // Builder template doesn't support sidebars
     if ('template-builder.php' === get_page_template_slug()) {
         $show_sidebar = false;
     }
     /**
      * Allow developers to dynamically changed the result of the "has sidebar" check.
      *
      * @since 1.2.3.
      *
      * @param bool      $show_sidebar    Whether or not to show the sidebar.
      * @param string    $location        The location of the sidebar being evaluated.
      * @param string    $view            The view name.
      */
     return apply_filters('make_has_sidebar', $show_sidebar, $location, $view);
 }
开发者ID:jalex403,项目名称:make,代码行数:34,代码来源:extras.php

示例8: ttfmake_get_view

<?php

/**
 * @package Make
 */
$taxonomy_view = ttfmake_get_view();
$category_key = 'layout-' . $taxonomy_view . '-show-categories';
$tag_key = 'layout-' . $taxonomy_view . '-show-tags';
$category_option = (bool) get_theme_mod($category_key, ttfmake_get_default($category_key));
$tag_option = (bool) get_theme_mod($tag_key, ttfmake_get_default($tag_key));
?>

<?php 
if (($category_option || $tag_option) && (has_category() && ttfmake_categorized_blog() || has_tag())) {
    ?>
	<?php 
    $category_list = get_the_category_list();
    $tag_list = get_the_tag_list('<ul class="post-tags"><li>', "</li>\n<li>", '</li></ul>');
    // Replicates category output
    $taxonomy_output = '';
    // Categories
    if ($category_option && $category_list) {
        $taxonomy_output .= __('<i class="fa fa-file"></i> ', 'make') . '%1$s';
    }
    // Tags
    if ($tag_option && $tag_list) {
        $taxonomy_output .= __('<i class="fa fa-tag"></i> ', 'make') . '%2$s';
    }
    // Output
    printf($taxonomy_output, $category_list, $tag_list);
}
开发者ID:marceloroberto,项目名称:make,代码行数:31,代码来源:entry-taxonomy.php

示例9: ttfmake_yoast_seo_breadcrumb

/**
 * Add the Yoast SEO breadcrumb, if the plugin is activated.
 *
 * @since 1.6.4.
 *
 * @return void
 */
function ttfmake_yoast_seo_breadcrumb()
{
    if (function_exists('yoast_breadcrumb')) {
        $key = 'layout-' . ttfmake_get_view() . '-yoast-breadcrumb';
        $option = absint(get_theme_mod($key, ttfmake_get_default($key)));
        if (1 === $option || is_404()) {
            yoast_breadcrumb('<p class="yoast-seo-breadcrumb">', '</p>');
        }
    }
}
开发者ID:kevinotsuka,项目名称:coffeecircle,代码行数:17,代码来源:template-tags.php

示例10: ttfmake_get_view

<?php

/**
 * @package Make
 */
$date_key = 'layout-' . ttfmake_get_view() . '-post-date';
$date_option = ttfmake_sanitize_choice(get_theme_mod($date_key, ttfmake_get_default($date_key)), $date_key);
// Get date string
$date_string = get_the_date();
if ('relative' === $date_option) {
    $date_string = sprintf(__('%s ago', 'make'), human_time_diff(get_the_time('U'), current_time('timestamp')));
}
// Add permalink if not single view
if (!is_singular()) {
    $date_string = '<a href="' . get_permalink() . '" rel="bookmark">' . $date_string . '</a>';
}
?>

<?php 
if ('none' !== $date_option) {
    ?>
<time class="entry-date published" datetime="<?php 
    the_time('c');
    ?>
"><?php 
    echo $date_string;
    ?>
</time>
<?php 
}
开发者ID:fovoc,项目名称:make,代码行数:30,代码来源:entry-date.php

示例11: ttfmake_get_view

<?php

/**
 * @package CriticaLink
 */
$title_key = 'layout-' . ttfmake_get_view() . '-hide-title';
$title_option = (bool) get_theme_mod($title_key, ttfmake_get_default($title_key));
?>

<?php 
if (get_the_title() && !$title_option) {
    ?>
<h1 class="entry-title">
	<?php 
    the_title();
    ?>
</h1>
<?php 
}
开发者ID:helgatheviking,项目名称:criticalink,代码行数:19,代码来源:entry-title-video.php

示例12: the_content

<?php

/**
 * @package Make
 */
// Posts and Pages
if (is_singular()) {
    the_content();
    // Blog, Archives, Search Results
} else {
    $content_key = 'layout-' . ttfmake_get_view() . '-auto-excerpt';
    $content_option = (bool) get_theme_mod($content_key, ttfmake_get_default($content_key));
    if ($content_option || has_excerpt()) {
        echo wpautop(get_the_excerpt() . "\n\n" . ttfmake_get_read_more());
    } else {
        the_content(ttfmake_get_read_more('', ''));
    }
}
开发者ID:fovoc,项目名称:make,代码行数:18,代码来源:entry-content.php

示例13: ttfmake_get_view

<?php

/**
 * @package Make
 */
$author_key = 'layout-' . ttfmake_get_view() . '-post-author';
$author_option = ttfmake_sanitize_choice(get_theme_mod($author_key, ttfmake_get_default($author_key)), $author_key);
?>

<?php 
if ('none' !== $author_option) {
    ?>
<div class="entry-author">
	<?php 
    if ('avatar' === $author_option) {
        ?>
	<div class="entry-author-avatar">
		<?php 
        printf('<a class="vcard" href="%1$s">%2$s</a>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), get_avatar(get_the_author_meta('ID')));
        ?>
	</div>
	<?php 
    }
    ?>
	<div class="entry-author-byline">
		<?php 
    printf(_x('by %s', 'author byline', 'make'), sprintf('<a class="vcard fn" href="%1$s">%2$s</a>', esc_url(get_author_posts_url(get_the_author_meta('ID'))), esc_html(get_the_author_meta('display_name'))));
    ?>
	</div>
	<?php 
    if (is_singular() && ($author_bio = get_the_author_meta('description'))) {
开发者ID:marceloroberto,项目名称:make,代码行数:31,代码来源:entry-author.php


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