• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP presscore_get_template_part函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: presscore_blog_ajax_loading_responce

 function presscore_blog_ajax_loading_responce($ajax_data = array())
 {
     global $post, $wp_query, $paged, $page;
     extract($ajax_data);
     if (!$nonce || !$post_id || !$post_paged || !$target_page || !wp_verify_nonce($nonce, 'presscore-posts-ajax')) {
         $responce = array('success' => false, 'reason' => 'corrupted data');
     } else {
         require_once PRESSCORE_EXTENSIONS_DIR . '/aq_resizer.php';
         require_once PRESSCORE_DIR . '/template-hooks.php';
         require_once PRESSCORE_EXTENSIONS_DIR . '/dt-pagination.php';
         // get page
         query_posts(array('post_type' => 'page', 'page_id' => $post_id, 'post_status' => 'publish', 'page' => $target_page));
         $html = '';
         if (have_posts() && !post_password_required()) {
             while (have_posts()) {
                 the_post();
                 // main loop
                 $config = Presscore_Config::get_instance();
                 $config->set('template', 'blog');
                 $config->set('layout', empty($page_data['layout']) ? 'masonry' : $page_data['layout']);
                 presscore_config_base_init();
                 presscore_react_on_categorizer();
                 do_action('presscore_before_loop');
                 ob_start();
                 $query = presscore_get_blog_query();
                 if ($query->have_posts()) {
                     $page_layout = presscore_get_current_layout_type();
                     $current_post = $posts_count;
                     while ($query->have_posts()) {
                         $query->the_post();
                         /*
                         						// check if current post already loaded
                         						$key_in_loaded = array_search( $post->ID, $loaded_items );
                         						if ( false !== $key_in_loaded ) {
                         							unset( $loaded_items[ $key_in_loaded ] );
                         							continue;
                         						}
                         */
                         presscore_populate_post_config();
                         switch ($page_layout) {
                             case 'masonry':
                                 presscore_get_template_part('theme', 'blog/masonry/blog-masonry-post');
                                 break;
                             case 'list':
                                 // global posts counter
                                 $config->set('post.query.var.current_post', ++$current_post);
                                 presscore_get_template_part('theme', 'blog/list/blog-list-post');
                                 break;
                         }
                     }
                     wp_reset_postdata();
                 }
                 $html .= ob_get_clean();
             }
             $responce = array('success' => true);
             ///////////////////
             // pagination //
             ///////////////////
             $next_page_link = dt_get_next_posts_url($query->max_num_pages);
             if ($next_page_link) {
                 $responce['nextPage'] = dt_get_paged_var() + 1;
             } else {
                 $responce['nextPage'] = 0;
             }
             $load_style = $config->get('load_style');
             // pagination style
             if (presscore_is_load_more_pagination()) {
                 $pagination = dt_get_next_page_button($query->max_num_pages, 'paginator paginator-more-button with-ajax');
                 if ($pagination) {
                     $responce['currentPage'] = dt_get_paged_var();
                     $responce['paginationHtml'] = $pagination;
                 } else {
                     $responce['currentPage'] = $post_paged;
                 }
                 $responce['paginationType'] = 'more';
             } else {
                 if ('ajax_pagination' == $load_style) {
                     ob_start();
                     dt_paginator($query, array('class' => 'paginator with-ajax', 'ajaxing' => true));
                     $pagination = ob_get_clean();
                     if ($pagination) {
                         $responce['paginationHtml'] = $pagination;
                     }
                     $responce['paginationType'] = 'paginator';
                 }
             }
             /////////////////
             // response //
             /////////////////
             $responce['itemsToDelete'] = array_values($loaded_items);
             // $responce['query'] = $page_query->query;
             $responce['order'] = $query->query['order'];
             $responce['orderby'] = $query->query['orderby'];
         }
         // main loop
         $responce['html'] = $html;
     }
     return $responce;
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:99,代码来源:blog-helpers.php


示例2: 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();
             presscore_get_template_part('mod_albums', 'photo-masonry/photo');
         }
         // 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;
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:26,代码来源:photos-jgrid.php


示例3: custom_loop

 protected function custom_loop()
 {
     do_action('presscore_before_loop');
     $page_query = presscore_get_filtered_posts(array('post_type' => 'dt_portfolio', 'taxonomy' => 'dt_portfolio_category'));
     if ($page_query->have_posts()) {
         $page_layout = presscore_get_current_layout_type();
         $current_post = $this->input['posts_count'];
         while ($page_query->have_posts()) {
             $page_query->the_post();
             // populate post config
             presscore_populate_portfolio_config();
             // post template
             switch ($page_layout) {
                 case 'masonry':
                     presscore_get_template_part('mod_portfolio', 'masonry/project');
                     break;
                 case 'list':
                     // global posts counter
                     $this->config->set('post.query.var.current_post', ++$current_post);
                     presscore_get_template_part('mod_portfolio', 'list/project');
                     break;
             }
         }
         wp_reset_postdata();
     }
     return $page_query;
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:27,代码来源:class-mod-portfolio-ajax-content-builder.php


示例4: archive_post_content

 public function archive_post_content($html)
 {
     if (!$html) {
         ob_start();
         presscore_populate_team_config();
         presscore_get_template_part('mod_team', 'team-post');
         $html = ob_get_contents();
         ob_end_clean();
     }
     return $html;
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:11,代码来源:class-mod-team-public.php


示例5: archive_post_content

 public function archive_post_content($html)
 {
     if (!$html) {
         ob_start();
         presscore_populate_portfolio_config();
         presscore_get_template_part('mod_portfolio', 'masonry/project');
         $html = ob_get_contents();
         ob_end_clean();
     }
     return $html;
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:11,代码来源:class-mod-portfolio-public.php


示例6: custom_loop

 protected function custom_loop()
 {
     do_action('presscore_before_loop');
     $page_query = presscore_mod_albums_get_photos();
     if ($page_query->have_posts()) {
         while ($page_query->have_posts()) {
             $page_query->the_post();
             presscore_get_template_part('mod_albums', 'photo-masonry/photo');
         }
         wp_reset_postdata();
     }
     return $page_query;
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:13,代码来源:class-mod-media-ajax-content-builder.php


示例7: archive_post_content

 public function archive_post_content($html)
 {
     if (!$html) {
         ob_start();
         add_filter('presscore_get_images_gallery_hoovered-title_img_args', 'presscore_gallery_post_exclude_featured_image_from_gallery', 15, 3);
         presscore_populate_album_post_config();
         presscore_get_template_part('mod_albums', 'album-masonry/album');
         remove_filter('presscore_get_images_gallery_hoovered-title_img_args', 'presscore_gallery_post_exclude_featured_image_from_gallery', 15, 3);
         $html = ob_get_contents();
         ob_end_clean();
     }
     return $html;
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:13,代码来源:class-mod-albums-public.php


示例8: presscore_archive_post_content

 function presscore_archive_post_content()
 {
     $post_type = get_post_type();
     $html = apply_filters("presscore_archive_post_content-{$post_type}", '');
     if ($html) {
         echo $html;
     } else {
         if ('post' == $post_type) {
             presscore_config()->set('show_details', false);
             presscore_populate_post_config();
             presscore_get_template_part('theme', 'blog/masonry/blog-masonry-post');
         } else {
             presscore_get_template_part('theme', 'content-archive');
         }
     }
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:16,代码来源:archive-functions.php


示例9: custom_loop

 protected function custom_loop()
 {
     do_action('presscore_before_loop');
     $page_query = presscore_get_filtered_posts(array('post_type' => 'dt_gallery', 'taxonomy' => 'dt_gallery_category'));
     if ($page_query->have_posts()) {
         add_filter('presscore_get_images_gallery_hoovered-title_img_args', 'presscore_gallery_post_exclude_featured_image_from_gallery', 15, 3);
         while ($page_query->have_posts()) {
             $page_query->the_post();
             // populate post config
             presscore_populate_album_post_config();
             presscore_get_template_part('mod_albums', 'album-masonry/album');
         }
         wp_reset_postdata();
         remove_filter('presscore_get_images_gallery_hoovered-title_img_args', 'presscore_gallery_post_exclude_featured_image_from_gallery', 15, 3);
     }
     return $page_query;
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:17,代码来源:class-mod-albums-ajax-content-builder.php


示例10: 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();
                    presscore_get_template_part('mod_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;
        }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:42,代码来源:team.php


示例11: 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">';
             presscore_get_template_part('mod_albums', 'photo-masonry/photo');
             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;
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:40,代码来源:photos-slider.php


示例12: widget

 function widget($args, $instance)
 {
     extract($args);
     $instance = wp_parse_args((array) $instance, self::$widget_defaults);
     /* Our variables from the widget settings. */
     $title = apply_filters('widget_title', $instance['title']);
     $args = array('no_found_rows' => 1, 'posts_per_page' => $instance['show'], 'post_type' => 'dt_testimonials', 'post_status' => 'publish', 'orderby' => $instance['orderby'], 'order' => $instance['order'], 'tax_query' => array(array('taxonomy' => 'dt_testimonials_category', 'field' => 'term_id', 'terms' => $instance['cats'])));
     switch ($instance['select']) {
         case 'only':
             $args['tax_query'][0]['operator'] = 'IN';
             break;
         case 'except':
             $args['tax_query'][0]['operator'] = 'NOT IN';
             break;
         default:
             unset($args['tax_query']);
     }
     $p_query = new WP_Query($args);
     $autoslide = absint($instance['autoslide']);
     echo $before_widget . "\n";
     // title
     if ($title) {
         echo $before_title . $title . $after_title . "\n";
     }
     if ($p_query->have_posts()) {
         echo '<ul class="testimonials slider-content rsContW"' . ($autoslide ? ' data-autoslide="' . $autoslide . '"' : '') . '>', "\n";
         while ($p_query->have_posts()) {
             $p_query->the_post();
             echo '<li>';
             presscore_get_template_part('mod_testimonials', 'testimonials-post');
             echo '</li>';
         }
         // while have posts
         wp_reset_postdata();
         echo '</ul>', "\n";
     }
     // if have posts
     echo $after_widget . "\n";
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:39,代码来源:testimonials-slider.php


示例13: 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');
             presscore_get_template_part('mod_portfolio', 'masonry/project');
             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;
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:38,代码来源:portfolio-slider.php


示例14: 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">';
             presscore_get_template_part('theme', '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;
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:37,代码来源:blog-slider.php


示例15: post_template

 protected function post_template()
 {
     presscore_populate_portfolio_config();
     presscore_get_template_part('mod_portfolio', 'masonry/project');
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:5,代码来源:portfolio-jgrid.php


示例16: render_teammate

 protected function render_teammate($instance = array())
 {
     presscore_get_template_part('mod_team', 'team-post-raw');
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:4,代码来源:team.php


示例17: presscore_header_class

if (!defined('ABSPATH')) {
    exit;
}
?>

<div <?php 
presscore_header_class('masthead side-header slide-out');
?>
 role="banner">

	<header class="header-bar">

		<?php 
presscore_get_template_part('theme', 'header/branding');
?>

		<?php 
presscore_get_template_part('theme', 'header/primary-menu');
?>

		<?php 
presscore_render_header_elements('below_menu');
?>

	</header>

</div>

<?php 
presscore_get_template_part('theme', 'header/mixed-header', presscore_get_mixed_header_layout());
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:30,代码来源:header-slide-out.php


示例18: post_template

 protected function post_template()
 {
     presscore_populate_album_post_config();
     presscore_get_template_part('mod_albums', 'album-masonry/album');
 }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:5,代码来源:albums.php


示例19: do_action

>

	<?php 
do_action('presscore_before_post_content');
if (!post_password_required()) {
    switch (presscore_config()->get('post.media.type')) {
        case 'photo_scroller':
            break;
        case 'jgrid':
        case 'masonry_grid':
            presscore_get_template_part('mod_albums', 'albums-post-single-media');
            break;
        default:
            echo '<div class="wf-container">';
            echo '<div class="wf-cell wf-1 project-slider">';
            presscore_get_template_part('mod_albums', 'albums-post-single-media');
            echo '</div>';
            echo '</div>';
    }
    if (get_the_content()) {
        echo '<div class="wf-container">';
        echo '<div class="wf-cell wf-1 project-content">';
        the_content();
        echo '</div>';
        echo '</div>';
    }
} else {
    the_content();
}
do_action('presscore_after_post_content');
?>
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:31,代码来源:content-single-gallery.php


示例20: presscore_masonry_container_class

 $config_backup = $config->get();
 // 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', 'dt-gallery-container')) . presscore_masonry_container_data_atts() . presscore_get_share_buttons_for_prettyphoto('photo') . '>';
 //////////////////////
 // Custom loop //
 //////////////////////
 if (function_exists('presscore_mod_albums_get_photos')) {
     $page_query = presscore_mod_albums_get_photos();
     if ($page_query->have_posts()) {
         while ($page_query->have_posts()) {
             $page_query->the_post();
             presscore_get_template_part('mod_albums', 'photo-masonry/photo');
         }
         wp_reset_postdata();
     }
 }
 // masonry container close
 echo '</div>';
 // fullwidth wrap close
 if ($config->get('full_width')) {
     echo '</div>';
 }
 /////////////////////
 // Pagination //
 /////////////////////
 presscore_complex_pagination($page_query);
 // restore config
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:31,代码来源:template-media-jgrid.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap