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

PHP et_pb_post_format函数代码示例

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

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



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

示例1: the_title

							<h1 class="entry-title"><?php 
        the_title();
        ?>
</h1>

						<?php 
        if (!post_password_required()) {
            et_divi_post_meta();
            $thumb = '';
            $width = (int) apply_filters('et_pb_index_blog_image_width', 1080);
            $height = (int) apply_filters('et_pb_index_blog_image_height', 675);
            $classtext = 'et_featured_image';
            $titletext = get_the_title();
            $thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Blogimage');
            $thumb = $thumbnail["thumb"];
            $post_format = et_pb_post_format();
            if ('video' === $post_format && false !== ($first_video = et_get_first_video())) {
                printf('<div class="et_main_video_container">
											%1$s
										</div>', $first_video);
            } else {
                if (!in_array($post_format, array('gallery', 'link', 'quote')) && 'on' === et_get_option('divi_thumbnails', 'on') && '' !== $thumb) {
                    print_thumbnail($thumb, $thumbnail["use_timthumb"], $titletext, $width, $height);
                } else {
                    if ('gallery' === $post_format) {
                        et_pb_gallery_images();
                    }
                }
            }
            ?>
开发者ID:rw1982,项目名称:robwcreate.com-wptheme,代码行数:30,代码来源:single.php


示例2: shortcode_callback

    function shortcode_callback($atts, $content = null, $function_name)
    {
        $module_id = $this->shortcode_atts['module_id'];
        $module_class = $this->shortcode_atts['module_class'];
        $fullwidth = $this->shortcode_atts['fullwidth'];
        $posts_number = $this->shortcode_atts['posts_number'];
        $include_categories = $this->shortcode_atts['include_categories'];
        $meta_date = $this->shortcode_atts['meta_date'];
        $show_thumbnail = $this->shortcode_atts['show_thumbnail'];
        $show_content = $this->shortcode_atts['show_content'];
        $show_author = $this->shortcode_atts['show_author'];
        $show_date = $this->shortcode_atts['show_date'];
        $show_categories = $this->shortcode_atts['show_categories'];
        $show_comments = $this->shortcode_atts['show_comments'];
        $show_pagination = $this->shortcode_atts['show_pagination'];
        $background_layout = $this->shortcode_atts['background_layout'];
        $show_more = $this->shortcode_atts['show_more'];
        $offset_number = $this->shortcode_atts['offset_number'];
        $masonry_tile_background_color = $this->shortcode_atts['masonry_tile_background_color'];
        $use_dropshadow = $this->shortcode_atts['use_dropshadow'];
        global $paged;
        $module_class = ET_Builder_Element::add_module_order_class($module_class, $function_name);
        $container_is_closed = false;
        if ('' !== $masonry_tile_background_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_blog_grid .et_pb_post', 'declaration' => sprintf('background-color: %1$s;', esc_html($masonry_tile_background_color))));
        }
        if ('on' !== $fullwidth) {
            if ('on' === $use_dropshadow) {
                $module_class .= ' et_pb_blog_grid_dropshadow';
            }
            wp_enqueue_script('salvattore');
            $background_layout = 'light';
        }
        $args = array('posts_per_page' => (int) $posts_number);
        $et_paged = is_front_page() ? get_query_var('page') : get_query_var('paged');
        if (is_front_page()) {
            $paged = $et_paged;
        }
        if ('' !== $include_categories) {
            $args['cat'] = $include_categories;
        }
        if (!is_search()) {
            $args['paged'] = $et_paged;
        }
        if ('' !== $offset_number && !empty($offset_number)) {
            /**
             * Offset + pagination don't play well. Manual offset calculation required
             * @see: https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination
             */
            if ($paged > 1) {
                $args['offset'] = ($et_paged - 1) * intval($posts_number) + intval($offset_number);
            } else {
                $args['offset'] = intval($offset_number);
            }
        }
        if (is_single() && !isset($args['post__not_in'])) {
            $args['post__not_in'] = array(get_the_ID());
        }
        ob_start();
        query_posts($args);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                $post_format = et_pb_post_format();
                $thumb = '';
                $width = 'on' === $fullwidth ? 1080 : 400;
                $width = (int) apply_filters('et_pb_blog_image_width', $width);
                $height = 'on' === $fullwidth ? 675 : 250;
                $height = (int) apply_filters('et_pb_blog_image_height', $height);
                $classtext = 'on' === $fullwidth ? 'et_pb_post_main_image' : '';
                $titletext = get_the_title();
                $thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Blogimage');
                $thumb = $thumbnail["thumb"];
                $no_thumb_class = '' === $thumb || 'off' === $show_thumbnail ? ' et_pb_no_thumb' : '';
                if (in_array($post_format, array('video', 'gallery'))) {
                    $no_thumb_class = '';
                }
                ?>

			<article id="post-<?php 
                the_ID();
                ?>
" <?php 
                post_class('et_pb_post' . $no_thumb_class);
                ?>
>

			<?php 
                et_divi_post_format_content();
                if (!in_array($post_format, array('link', 'audio', 'quote'))) {
                    if ('video' === $post_format && false !== ($first_video = et_get_first_video())) {
                        printf('<div class="et_main_video_container">
								%1$s
							</div>', $first_video);
                    } elseif ('gallery' === $post_format) {
                        et_gallery_images();
                    } elseif ('' !== $thumb && 'on' === $show_thumbnail) {
                        if ('on' !== $fullwidth) {
                            echo '<div class="et_pb_image_container">';
                        }
//.........这里部分代码省略.........
开发者ID:acchs,项目名称:test,代码行数:101,代码来源:main-modules.php


示例3: et_video_embed_html

function et_video_embed_html($video)
{
    if (is_single() && 'video' === et_pb_post_format()) {
        static $post_video_num = 0;
        $post_video_num++;
        // Hide first video in the post content on single video post page
        if (1 === $post_video_num) {
            return '';
        }
    }
    return "<div class='et_post_video'>{$video}</div>";
}
开发者ID:welearncodes,项目名称:traktern,代码行数:12,代码来源:functions.php


示例4: shortcode_callback

    function shortcode_callback($atts, $content = null, $function_name)
    {
        /**
         * Cached $wp_filter so it can be restored at the end of the callback.
         * This is needed because this callback uses the_content filter / calls a function
         * which uses the_content filter. WordPress doesn't support nested filter
         */
        global $wp_filter;
        $wp_filter_cache = $wp_filter;
        $module_id = $this->shortcode_atts['module_id'];
        $module_class = $this->shortcode_atts['module_class'];
        $fullwidth = $this->shortcode_atts['fullwidth'];
        $posts_number = $this->shortcode_atts['posts_number'];
        $include_categories = $this->shortcode_atts['include_categories'];
        $meta_date = $this->shortcode_atts['meta_date'];
        $show_thumbnail = $this->shortcode_atts['show_thumbnail'];
        $show_content = $this->shortcode_atts['show_content'];
        $show_author = $this->shortcode_atts['show_author'];
        $show_date = $this->shortcode_atts['show_date'];
        $show_categories = $this->shortcode_atts['show_categories'];
        $show_comments = $this->shortcode_atts['show_comments'];
        $show_pagination = $this->shortcode_atts['show_pagination'];
        $background_layout = $this->shortcode_atts['background_layout'];
        $show_more = $this->shortcode_atts['show_more'];
        $offset_number = $this->shortcode_atts['offset_number'];
        $masonry_tile_background_color = $this->shortcode_atts['masonry_tile_background_color'];
        $use_dropshadow = $this->shortcode_atts['use_dropshadow'];
        $overlay_icon_color = $this->shortcode_atts['overlay_icon_color'];
        $hover_overlay_color = $this->shortcode_atts['hover_overlay_color'];
        $hover_icon = $this->shortcode_atts['hover_icon'];
        $use_overlay = $this->shortcode_atts['use_overlay'];
        global $paged;
        $module_class = ET_Builder_Element::add_module_order_class($module_class, $function_name);
        $container_is_closed = false;
        // remove all filters from WP audio shortcode to make sure current theme doesn't add any elements into audio module
        remove_all_filters('wp_audio_shortcode_library');
        remove_all_filters('wp_audio_shortcode');
        remove_all_filters('wp_audio_shortcode_class');
        if ('' !== $masonry_tile_background_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_blog_grid .et_pb_post', 'declaration' => sprintf('background-color: %1$s;', esc_html($masonry_tile_background_color))));
        }
        if ('' !== $overlay_icon_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%% .et_overlay:before', 'declaration' => sprintf('color: %1$s !important;', esc_html($overlay_icon_color))));
        }
        if ('' !== $hover_overlay_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%% .et_overlay', 'declaration' => sprintf('background-color: %1$s;', esc_html($hover_overlay_color))));
        }
        if ('on' === $use_overlay) {
            $data_icon = '' !== $hover_icon ? sprintf(' data-icon="%1$s"', esc_attr(et_pb_process_font_icon($hover_icon))) : '';
            $overlay_output = sprintf('<span class="et_overlay%1$s"%2$s></span>', '' !== $hover_icon ? ' et_pb_inline_icon' : '', $data_icon);
        }
        $overlay_class = 'on' === $use_overlay ? ' et_pb_has_overlay' : '';
        if ('on' !== $fullwidth) {
            if ('on' === $use_dropshadow) {
                $module_class .= ' et_pb_blog_grid_dropshadow';
            }
            wp_enqueue_script('salvattore');
            $background_layout = 'light';
        }
        $args = array('posts_per_page' => (int) $posts_number);
        $et_paged = is_front_page() ? get_query_var('page') : get_query_var('paged');
        if (is_front_page()) {
            $paged = $et_paged;
        }
        if ('' !== $include_categories) {
            $args['cat'] = $include_categories;
        }
        if (!is_search()) {
            $args['paged'] = $et_paged;
        }
        if ('' !== $offset_number && !empty($offset_number)) {
            /**
             * Offset + pagination don't play well. Manual offset calculation required
             * @see: https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination
             */
            if ($paged > 1) {
                $args['offset'] = ($et_paged - 1) * intval($posts_number) + intval($offset_number);
            } else {
                $args['offset'] = intval($offset_number);
            }
        }
        if (is_single() && !isset($args['post__not_in'])) {
            $args['post__not_in'] = array(get_the_ID());
        }
        ob_start();
        query_posts($args);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                $post_format = et_pb_post_format();
                $thumb = '';
                $width = 'on' === $fullwidth ? 1080 : 400;
                $width = (int) apply_filters('et_pb_blog_image_width', $width);
                $height = 'on' === $fullwidth ? 675 : 250;
                $height = (int) apply_filters('et_pb_blog_image_height', $height);
                $classtext = 'on' === $fullwidth ? 'et_pb_post_main_image' : '';
                $titletext = get_the_title();
                $thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Blogimage');
                $thumb = $thumbnail["thumb"];
                $no_thumb_class = '' === $thumb || 'off' === $show_thumbnail ? ' et_pb_no_thumb' : '';
//.........这里部分代码省略.........
开发者ID:pacificano,项目名称:pacificano,代码行数:101,代码来源:main-modules.php


示例5: et_divi_post_format_content

    function et_divi_post_format_content()
    {
        $post_format = et_pb_post_format();
        $text_color_class = et_divi_get_post_text_color();
        $inline_style = et_divi_get_post_bg_inline_style();
        switch ($post_format) {
            case 'audio':
                printf('<div class="et_audio_content%4$s"%5$s>
						<h2><a href="%3$s">%1$s</a></h2>
						%2$s
					</div> <!-- .et_audio_content -->', get_the_title(), et_pb_get_audio_player(), esc_url(get_permalink()), esc_attr($text_color_class), $inline_style);
                break;
            case 'quote':
                printf('<div class="et_quote_content%4$s"%5$s>
						%1$s
						<a href="%2$s" class="et_quote_main_link">%3$s</a>
					</div> <!-- .et_quote_content -->', et_get_blockquote_in_content(), esc_url(get_permalink()), __('Read more', 'Divi'), esc_attr($text_color_class), $inline_style);
                break;
            case 'link':
                printf('<div class="et_link_content%5$s"%6$s>
						<h2><a href="%2$s">%1$s</a></h2>
						<a href="%3$s" class="et_link_main_url">%4$s</a>
					</div> <!-- .et_link_content -->', get_the_title(), esc_url(get_permalink()), esc_url(et_get_link_url()), esc_html(et_get_link_url()), esc_attr($text_color_class), $inline_style);
                break;
        }
    }
开发者ID:Lumbe,项目名称:dev_servus,代码行数:26,代码来源:functions.php


示例6: shortcode_callback

    function shortcode_callback($atts, $content = null, $function_name)
    {
        $module_id = $this->shortcode_atts['module_id'];
        $module_class = $this->shortcode_atts['module_class'];
        $fullwidth = $this->shortcode_atts['fullwidth'];
        $posts_number = $this->shortcode_atts['posts_number'];
        $include_categories = $this->shortcode_atts['include_categories'];
        $meta_date = $this->shortcode_atts['meta_date'];
        $show_thumbnail = $this->shortcode_atts['show_thumbnail'];
        $show_content = $this->shortcode_atts['show_content'];
        $show_author = $this->shortcode_atts['show_author'];
        $show_date = $this->shortcode_atts['show_date'];
        $show_categories = $this->shortcode_atts['show_categories'];
        $show_comments = $this->shortcode_atts['show_comments'];
        $show_pagination = $this->shortcode_atts['show_pagination'];
        $background_layout = $this->shortcode_atts['background_layout'];
        $show_more = $this->shortcode_atts['show_more'];
        $offset_number = $this->shortcode_atts['offset_number'];
        $masonry_tile_background_color = $this->shortcode_atts['masonry_tile_background_color'];
        $use_dropshadow = $this->shortcode_atts['use_dropshadow'];
        global $paged;
        $module_class = ET_Builder_Element::add_module_order_class($module_class, $function_name);
        $container_is_closed = false;
        // remove all filters from WP audio shortcode to make sure current theme doesn't add any elements into audio module
        remove_all_filters('wp_audio_shortcode_library');
        remove_all_filters('wp_audio_shortcode');
        remove_all_filters('wp_audio_shortcode_class');
        if ('' !== $masonry_tile_background_color) {
            ET_Builder_Element::set_style($function_name, array('selector' => '%%order_class%%.et_pb_blog_grid .et_pb_post', 'declaration' => sprintf('background-color: %1$s;', esc_html($masonry_tile_background_color))));
        }
        if ('on' !== $fullwidth) {
            if ('on' === $use_dropshadow) {
                $module_class .= ' et_pb_blog_grid_dropshadow';
            }
            wp_enqueue_script('salvattore');
            $background_layout = 'light';
        }
        $args = array('posts_per_page' => (int) $posts_number);
        $et_paged = is_front_page() ? get_query_var('page') : get_query_var('paged');
        if (is_front_page()) {
            $paged = $et_paged;
        }
        if ('' !== $include_categories) {
            $args['cat'] = $include_categories;
        }
        if (!is_search()) {
            $args['paged'] = $et_paged;
        }
        if ('' !== $offset_number && !empty($offset_number)) {
            /**
             * Offset + pagination don't play well. Manual offset calculation required
             * @see: https://codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination
             */
            if ($paged > 1) {
                $args['offset'] = ($et_paged - 1) * intval($posts_number) + intval($offset_number);
            } else {
                $args['offset'] = intval($offset_number);
            }
        }
        if (is_single() && !isset($args['post__not_in'])) {
            $args['post__not_in'] = array(get_the_ID());
        }
        ob_start();
        query_posts($args);
        if (have_posts()) {
            ?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/masonry/3.3.2/masonry.pkgd.js"></script>
			<div class="grid js-masonry"
  data-masonry-options='{ "itemSelector": ".new-post", "columnWidth": ".grid-sizer", "percentPosition": true}'>
  <div class="grid-sizer"></div>
  <?php 
            while (have_posts()) {
                the_post();
                $post_format = et_pb_post_format();
                $thumb = '';
                $width = 'on' === $fullwidth ? 1080 : 400;
                $width = (int) apply_filters('et_pb_blog_image_width', $width);
                $height = 'on' === $fullwidth ? 675 : 250;
                $height = (int) apply_filters('et_pb_blog_image_height', $height);
                $classtext = 'on' === $fullwidth ? 'et_pb_post_main_image' : '';
                $titletext = get_the_title();
                $thumbnail = get_thumbnail($width, $height, $classtext, $titletext, $titletext, false, 'Blogimage');
                $thumb = $thumbnail["thumb"];
                $no_thumb_class = '' === $thumb || 'off' === $show_thumbnail ? ' et_pb_no_thumb' : '';
                if (in_array($post_format, array('video', 'gallery'))) {
                    $no_thumb_class = '';
                }
                ?>

			<article onclick="location.href='<?php 
                the_permalink();
                ?>
';" style="cursor:pointer;" id="post-<?php 
                the_ID();
                ?>
"  class="new-post  <?php 
                $cat_color = get_the_category();
                echo $cat_color[1]->slug;
                echo ' ';
                ?>
//.........这里部分代码省略.........
开发者ID:skonina,项目名称:M20_masonry,代码行数:101,代码来源:main-modules.php


示例7: et_remove_blockquote_from_content

function et_remove_blockquote_from_content($content)
{
    if ('quote' !== et_pb_post_format()) {
        return $content;
    }
    $content = preg_replace('/<blockquote>(.+?)<\\/blockquote>/is', '', $content, 1);
    return $content;
}
开发者ID:iinspiration,项目名称:theme,代码行数:8,代码来源:functions.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP et_postinfo_meta函数代码示例发布时间:2022-05-15
下一篇:
PHP et_pb_is_pagebuilder_used函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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