本文整理汇总了PHP中dt_get_template_part函数的典型用法代码示例。如果您正苦于以下问题:PHP dt_get_template_part函数的具体用法?PHP dt_get_template_part怎么用?PHP dt_get_template_part使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dt_get_template_part函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: shortcode_html
protected function shortcode_html()
{
$dt_query = $this->get_albums_attachments(array('orderby' => $this->atts['orderby'], 'order' => $this->atts['order'], 'number' => $this->atts['number'], 'select' => $this->atts['select'], 'category' => $this->atts['category']));
$output = '';
if ($dt_query->have_posts()) {
$this->backup_post_object();
$this->backup_theme_config();
$this->setup_config();
ob_start();
do_action('presscore_before_shortcode_loop', $this->shortcode_name, $this->atts);
// masonry container open
echo '<div ' . presscore_masonry_container_class(array('wf-container', 'dt-gallery-container', 'dt-photos-shortcode')) . presscore_masonry_container_data_atts() . presscore_get_share_buttons_for_prettyphoto('photo') . '>';
while ($dt_query->have_posts()) {
$dt_query->the_post();
dt_get_template_part('media/media-masonry-post');
}
// masonry container close
echo '</div>';
do_action('presscore_after_shortcode_loop', $this->shortcode_name, $this->atts);
$output = ob_get_contents();
ob_end_clean();
$this->restore_theme_config();
$this->restore_post_object();
}
return $output;
}
示例2: albums_jsgrid
protected function albums_jsgrid(&$attributes)
{
$output = '';
$dt_query = $this->get_posts_by_terms(array('orderby' => $attributes['orderby'], 'order' => $attributes['order'], 'number' => $attributes['number'], 'select' => $attributes['select'], 'category' => $attributes['category']));
if ($dt_query->have_posts()) {
$this->backup_post_object();
$this->backup_theme_config();
$this->setup_config($attributes);
ob_start();
do_action('presscore_before_shortcode_loop', $this->shortcode_name, $attributes);
// fullwidth wrap open
if ($attributes['full_width']) {
echo '<div class="full-width-wrap">';
}
// masonry container open
echo '<div ' . presscore_masonry_container_class(array('wf-container', 'dt-albums-shortcode')) . presscore_masonry_container_data_atts() . '>';
while ($dt_query->have_posts()) {
$dt_query->the_post();
presscore_populate_album_post_config();
dt_get_template_part('albums/masonry/albums-masonry-post');
}
// masonry container close
echo '</div>';
// fullwidth wrap close
if ($attributes['full_width']) {
echo '</div>';
}
do_action('presscore_after_shortcode_loop', $this->shortcode_name, $attributes);
$output = ob_get_contents();
ob_end_clean();
$this->restore_theme_config();
$this->restore_post_object();
}
return $output;
}
示例3: shortcode
public function shortcode($atts, $content = null)
{
$attributes = $this->sanitize_attributes($atts);
// vc inline dummy
if (presscore_vc_is_inline()) {
$terms_title = _x('Display categories', 'vc inline dummy', LANGUAGE_ZONE);
$terms_list = presscore_get_terms_list_by_slug(array('slugs' => $attributes['category'], 'taxonomy' => $this->taxonomy));
return $this->vc_inline_dummy(array('class' => 'dt_vc-photos_masonry', 'title' => _x('Photos masonry', 'vc inline dummy', LANGUAGE_ZONE), 'fields' => array($terms_title => $terms_list)));
}
$output = '';
$dt_query = $this->get_albums_attachments(array('orderby' => $attributes['orderby'], 'order' => $attributes['order'], 'number' => $attributes['number'], 'select' => $attributes['select'], 'category' => $attributes['category']));
if ($dt_query->have_posts()) {
$this->backup_post_object();
$this->backup_theme_config();
$this->setup_config($attributes);
ob_start();
do_action('presscore_before_shortcode_loop', $this->shortcode_name, $attributes);
// masonry container open
echo '<div ' . presscore_masonry_container_class(array('wf-container', 'dt-gallery-container', 'dt-photos-shortcode')) . presscore_masonry_container_data_atts() . presscore_get_share_buttons_for_prettyphoto('photo') . '>';
while ($dt_query->have_posts()) {
$dt_query->the_post();
dt_get_template_part('media/media-masonry-post');
}
// masonry container close
echo '</div>';
do_action('presscore_after_shortcode_loop', $this->shortcode_name, $attributes);
$output = ob_get_contents();
ob_end_clean();
$this->restore_theme_config();
$this->restore_post_object();
}
return $output;
}
示例4: shortcode
public function shortcode($atts, $content = null)
{
$attributes = $this->sanitize_attributes($atts);
// vc inline dummy
if (presscore_vc_is_inline()) {
$terms_title = _x('Display categories', 'vc inline dummy', LANGUAGE_ZONE);
$terms_list = presscore_get_terms_list_by_slug(array('slugs' => $attributes['category'], 'taxonomy' => $this->taxonomy));
return $this->vc_inline_dummy(array('class' => 'dt_vc-portfolio_jgrid', 'title' => _x('Portfolio justified grid', 'vc inline dummy', LANGUAGE_ZONE), 'fields' => array($terms_title => $terms_list)));
}
$output = '';
$dt_query = $this->get_posts_by_terms(array('orderby' => $attributes['orderby'], 'order' => $attributes['order'], 'number' => $attributes['number'], 'select' => $attributes['select'], 'category' => $attributes['category']));
if ($dt_query->have_posts()) {
$this->backup_post_object();
$this->backup_theme_config();
$this->setup_config($attributes);
ob_start();
do_action('presscore_before_shortcode_loop', $this->shortcode_name, $attributes);
// fullwidth wrap open
if ($attributes['full_width']) {
echo '<div class="full-width-wrap">';
}
// masonry container open
echo '<div ' . presscore_masonry_container_class(array('wf-container', 'dt-portfolio-shortcode')) . presscore_masonry_container_data_atts() . '>';
while ($dt_query->have_posts()) {
$dt_query->the_post();
presscore_populate_portfolio_config();
dt_get_template_part('portfolio/masonry/portfolio-masonry-post');
}
// masonry container close
echo '</div>';
// fullwidth wrap close
if ($attributes['full_width']) {
echo '</div>';
}
do_action('presscore_after_shortcode_loop', $this->shortcode_name, $attributes);
$output = ob_get_contents();
ob_end_clean();
$this->restore_theme_config();
$this->restore_post_object();
}
return $output;
}
示例5: shortcode
public function shortcode($atts, $content = null)
{
$attributes = $this->sanitize_attributes($atts);
if (presscore_vc_is_inline()) {
$terms_list = presscore_get_terms_list_by_slug(array('slugs' => $attributes['category'], 'taxonomy' => 'dt_team_category'));
$dummy = '
<div class="dt_vc-shortcode_dummy dt_vc-team" style="height: 250px;">
<h5>Team</h5>
<p class="text-small"><strong>Display categories:</strong> ' . $terms_list . '</p>
</div>
';
return $dummy;
}
$output = '';
$dt_query = $this->get_posts_by_terms($attributes);
if ($dt_query->have_posts()) {
$this->backup_post_object();
$this->backup_theme_config();
$this->setup_config($attributes);
ob_start();
do_action('presscore_before_shortcode_loop', $this->shortcode_name, $attributes);
if ($attributes['full_width']) {
echo '<div class="full-width-wrap">';
}
echo '<div ' . presscore_masonry_container_class(array('wf-container')) . presscore_masonry_container_data_atts() . '>';
while ($dt_query->have_posts()) {
$dt_query->the_post();
presscore_populate_team_config();
dt_get_template_part('team/team-post');
}
echo '</div>';
if ($attributes['full_width']) {
echo '</div>';
}
do_action('presscore_after_shortcode_loop', $this->shortcode_name, $attributes);
$output .= ob_get_contents();
ob_end_clean();
$this->restore_theme_config();
$this->restore_post_object();
}
return $output;
}
示例6: shortcode
public function shortcode($atts, $content = null)
{
$attributes = $this->atts = $this->sanitize_attributes($atts);
// vc inline dummy
if (presscore_vc_is_inline()) {
$terms_title = _x('Display categories', 'vc inline dummy', 'the7mk2');
$terms_list = presscore_get_terms_list_by_slug(array('slugs' => $attributes['category'], 'taxonomy' => $this->taxonomy));
return $this->vc_inline_dummy(array('class' => 'dt_vc-photos_scroller', 'title' => _x('Photos scroller', 'vc inline dummy', 'the7mk2'), 'fields' => array($terms_title => $terms_list)));
}
$output = '';
$dt_query = $this->get_albums_attachments(array('orderby' => $attributes['orderby'], 'order' => 'DESC', 'number' => $attributes['number'], 'select' => $attributes['select'], 'category' => $attributes['category']));
if ($dt_query->have_posts()) {
$this->backup_post_object();
$this->backup_theme_config();
$this->setup_config();
$this->add_hooks();
ob_start();
// loop
while ($dt_query->have_posts()) {
$dt_query->the_post();
echo '<li class="fs-entry">';
dt_get_template_part('media/media-masonry-post');
echo '</li>';
}
$posts_html = ob_get_contents();
ob_end_clean();
// shape output
$output = '<div ' . $this->get_container_html_class(array('dt-photos-shortcode', 'slider-wrapper', 'shortcode-instagram', 'dt-gallery-container')) . ' ' . $this->get_container_data_atts() . presscore_get_share_buttons_for_prettyphoto('photo') . '>';
$output .= '<div class="frame fullwidth-slider"><ul class="clearfix">' . $posts_html . '</ul></div>';
if ($attributes['arrows']) {
$output .= '<div class="prev"><i></i></div><div class="next"><i></i></div>';
}
$output .= '</div>';
// cleanup
$this->remove_hooks();
$this->restore_theme_config();
$this->restore_post_object();
}
return $output;
}
示例7: portfolio_slider
protected function portfolio_slider()
{
$output = '';
// query
$dt_query = $this->get_posts_by_terms(array('orderby' => $this->atts['orderby'], 'order' => $this->atts['order'], 'number' => $this->atts['number'], 'select' => $this->atts['select'], 'category' => $this->atts['category']));
if ($dt_query->have_posts()) {
// setup
$this->backup_post_object();
$this->backup_theme_config();
$this->setup_config();
$this->add_hooks();
ob_start();
// loop
while ($dt_query->have_posts()) {
$dt_query->the_post();
echo '<li class="fs-entry">';
presscore_populate_portfolio_config();
presscore_get_config()->set('post.preview.media.style', 'featured_image');
dt_get_template_part('portfolio/masonry/portfolio-masonry-post');
echo '</li>';
}
// store loop html
$posts_html = ob_get_contents();
ob_end_clean();
// shape output
$output = '<div ' . $this->get_container_html_class(array('dt-portfolio-shortcode', 'slider-wrapper')) . ' ' . $this->get_container_data_atts() . '>';
$output .= '<div class="frame fullwidth-slider"><ul class="clearfix">' . $posts_html . '</ul></div>';
if ($this->atts['arrows']) {
$output .= '<div class="prev"><i></i></div><div class="next"><i></i></div>';
}
$output .= '</div>';
// cleanup
$this->remove_hooks();
$this->restore_theme_config();
$this->restore_post_object();
}
return $output;
}
示例8: blog_masonry
private function blog_masonry()
{
$output = '';
$dt_query = $this->get_posts_by_terms(array('orderby' => $this->atts['orderby'], 'order' => $this->atts['order'], 'number' => $this->atts['number'], 'select' => $this->atts['select'], 'category' => $this->atts['category']));
if ($dt_query->have_posts()) {
$this->backup_post_object();
$this->backup_theme_config();
$this->setup_config();
ob_start();
do_action('presscore_before_shortcode_loop', $this->shortcode_name, $this->atts);
// fullwidth wrap open
if ($this->atts['full_width']) {
echo '<div class="full-width-wrap">';
}
// masonry container open
echo '<div ' . presscore_masonry_container_class(array('wf-container', 'dt-blog-shortcode')) . presscore_masonry_container_data_atts() . '>';
while ($dt_query->have_posts()) {
$dt_query->the_post();
presscore_populate_post_config();
$this->config->set('post.preview.gallery.style', 'hovered_gallery');
dt_get_template_part('blog/masonry/blog-masonry-post');
}
// masonry container close
echo '</div>';
// fullwidth wrap close
if ($this->atts['full_width']) {
echo '</div>';
}
do_action('presscore_after_shortcode_loop', $this->shortcode_name, $this->atts);
$output = ob_get_contents();
ob_end_clean();
// cleanup
$this->restore_theme_config();
$this->restore_post_object();
}
return $output;
}
示例9: slider
public function slider()
{
$output = '';
$attributes =& $this->atts;
// query
$dt_query = $this->get_posts_by_terms(array('orderby' => $attributes['orderby'], 'order' => $attributes['order'], 'number' => $attributes['number'], 'select' => $attributes['select'], 'category' => $attributes['category']));
if ($dt_query->have_posts()) {
// setup
$this->backup_post_object();
$this->backup_theme_config();
$this->setup_config();
$this->add_hooks();
ob_start();
// loop
while ($dt_query->have_posts()) {
$dt_query->the_post();
echo '<li class="fs-entry">';
dt_get_template_part('blog/masonry/blog-masonry-post');
echo '</li>';
}
// store loop html
$posts_html = ob_get_contents();
ob_end_clean();
// cleanup
$this->remove_hooks();
$this->restore_theme_config();
$this->restore_post_object();
// shape output
$output = '<div ' . $this->get_container_html_class(array('dt-blog-shortcode', 'slider-wrapper')) . ' ' . $this->get_container_data_atts() . '>';
$output .= '<div class="frame fullwidth-slider"><ul class="clearfix">' . $posts_html . '</ul></div>';
if ($attributes['arrows']) {
$output .= '<div class="prev"><i></i></div><div class="next"><i></i></div>';
}
$output .= '</div>';
}
return $output;
}
示例10: presscore_display_posts_filter
///////////////////////
presscore_display_posts_filter(array('post_type' => 'post', 'taxonomy' => 'category'));
echo '<div ' . presscore_list_container_html_class('articles-list') . presscore_list_container_data_atts() . '>';
//////////////////////
// Custom loop //
//////////////////////
$page_query = presscore_get_blog_query();
// start loop
if ($page_query->have_posts()) {
while ($page_query->have_posts()) {
$page_query->the_post();
// global posts counter
$config->set('post.query.var.current_post', $page_query->current_post + 1);
// populate config with current post settings
presscore_populate_post_config();
dt_get_template_part('blog/list/blog-list-post');
}
wp_reset_postdata();
}
echo '</div>';
/////////////////////
// Pagination //
/////////////////////
presscore_complex_pagination($page_query);
// restore config
$config->reset($config_backup);
}
do_action('presscore_after_loop');
}
}
// main loop
示例11: dt_get_template_part
}
$config = Presscore_Config::get_instance();
?>
<div class="rollover-project links-hovers-disabled">
<?php
dt_get_template_part('albums/masonry/albums-masonry-post-rollover-media');
?>
<?php
if ($config->get('post.preview.content.visible')) {
?>
<div class="rollover-content">
<?php
if ('on_hoover_centered' == $config->get('post.preview.description.style')) {
dt_get_template_part('albums/masonry/albums-masonry-post-rollover-content-centered');
} else {
dt_get_template_part('albums/masonry/albums-masonry-post-rollover-content');
}
?>
</div>
<?php
}
?>
</div>
示例12: get_post_meta
?>
<?php
if (!post_password_required()) {
?>
<?php
$media_layout = get_post_meta($post->ID, '_dt_project_media_options_layout', true);
// layout
switch ($media_layout) {
case 'before':
case 'after':
dt_get_template_part('portfolio-post-v');
break;
default:
dt_get_template_part('portfolio-post-h');
}
?>
<?php
} else {
?>
<?php
the_content();
?>
<?php
}
?>
示例13: presscore_masonry_container_class
// fullwidth wrap open
if ($config->get('full_width')) {
echo '<div class="full-width-wrap">';
}
// masonry container open
echo '<div ' . presscore_masonry_container_class(array('wf-container')) . presscore_masonry_container_data_atts() . '>';
//////////////////////
// Custom loop //
//////////////////////
$page_query = Presscore_Inc_Team_Post_Type::get_template_query();
if ($page_query->have_posts()) {
while ($page_query->have_posts()) {
$page_query->the_post();
// populate config
presscore_populate_team_config();
dt_get_template_part('team/team-post');
}
wp_reset_postdata();
}
// masonry container close
echo '</div>';
// fullwidth wrap close
if ($config->get('full_width')) {
echo '</div>';
}
/////////////////////
// Pagination //
/////////////////////
dt_paginator($page_query);
}
do_action('presscore_after_loop');
示例14: render_teammate
protected function render_teammate($instance = array())
{
echo '<div class="team-container' . (!$instance['show_excerpt'] ? ' description-off' : '') . '">';
dt_get_template_part('team/team-post-media');
echo '<div class="team-desc">';
dt_get_template_part('team/team-post-content');
echo '</div>';
echo '</div>';
}
示例15: presscore_get_post_content_style_for_blog_list
*
* @package vogue
* @since 1.0.0
*/
// File Security Check
if (!defined('ABSPATH')) {
exit;
}
?>
<div class="blog-content wf-td" <?php
echo presscore_get_post_content_style_for_blog_list('content');
?>
>
<?php
dt_get_template_part('blog/blog-post-content-part', get_post_format());
?>
<?php
$config = Presscore_Config::get_instance();
if ($config->get('show_details')) {
echo presscore_post_details_link();
}
?>
<?php
echo presscore_new_posted_on('post');
?>
<?php
echo presscore_post_edit_link();