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


PHP the_content函数代码示例

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


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

示例1: charity_vc_our_mission

function charity_vc_our_mission($atts, $content = null)
{
    extract(shortcode_atts(array('our_mission' => ''), $atts));
    $page_id = get_page_by_title($our_mission);
    $missionQuery = new WP_Query(array("page_id" => $page_id->ID));
    if ($missionQuery->have_posts()) {
        $missionQuery->the_post();
        $url = wp_get_attachment_image_src(get_post_thumbnail_id($page_id->ID), array(1143, 479));
        ?>
        <!-- Save Lives Section Start Here-->
        <section class="save-lives text-center parallax" style="background-image: url('<?php 
        echo esc_url($url[0]);
        ?>
')">
            <div class="container">
                <div class="row">
                    <div class="col-xs-12 col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3">
                        <header class="page-header">
                            <h2><?php 
        the_title();
        ?>
</h2>
                            <?php 
        the_content();
        ?>
                        </header>
                    </div>
                </div>
            </div>
        </section>
        <!-- Save Lives Section Start Here-->
    <?php 
    }
    wp_reset_postdata();
}
开发者ID:kautzar,项目名称:drpp4,代码行数:35,代码来源:our-mission.php

示例2: block

    function block($instance)
    {
        extract($instance);
        $query_args = array('post_type' => 'testimonial', 'posts_per_page' => $pppage);
        if (!($filter == 'all')) {
            if (function_exists('icl_object_id')) {
                $filter = (int) icl_object_id($filter, 'testimonial-category', true);
            }
            $query_args['tax_query'] = array(array('taxonomy' => 'testimonial-category', 'field' => 'id', 'terms' => $filter));
        }
        $testimonial_query = new WP_Query($query_args);
        if ($testimonial_query->have_posts()) {
            while ($testimonial_query->have_posts()) {
                $testimonial_query->the_post();
                ?>
	
		<div class="text-center services-1 col-md-3">
			<div class="col-wrapper">
				<?php 
                the_title('<h5 class="upper">', '</h5>');
                the_content();
                ?>
			</div>
		</div>
	
	<?php 
            }
        } else {
            /**
             * Display no posts message if none are found.
             */
            get_template_part('loop/content', 'none');
        }
        wp_reset_query();
    }
开发者ID:misfist,项目名称:loom-theme,代码行数:35,代码来源:testimonial_feed_block.php

示例3: load_5speed_archive

function load_5speed_archive()
{
    echo "<h3 class=\"list-title\">My list of reasons why I drive a manual transmission car:</h3>";
    echo "<div class=\"5speed\">";
    while (have_posts()) {
        the_post();
        ?>
        <li>
            <h3 style="margin-bottom:0px;"># <a href="<?php 
        the_permalink();
        ?>
" rel="bookmark" title="Reason <?php 
        the_title_attribute();
        ?>
"><?php 
        the_title();
        ?>
</a></h3>
            <?php 
        the_content();
        ?>
        </li>
    <?php 
    }
    echo "</div>";
}
开发者ID:SloppierKitty7,项目名称:wp-theme-gus,代码行数:26,代码来源:postype-5speed.php

示例4: widget

 /**
  * Display widget content.
  *
  * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget.
  * @param array $instance The settings for the particular instance of the widget
  */
 function widget($args, $instance)
 {
     extract($args);
     $instance = wp_parse_args((array) $instance, $this->defaults);
     $featured_page = new WP_Query(array('page_id' => $instance['page_id']));
     echo $before_widget . '<div class="feature-page">';
     if (!empty($instance['title'])) {
         echo $before_title . apply_filters('widget_title', $instance['title'], $instance, $this->id_base) . $after_title;
     }
     if ($featured_page->have_posts()) {
         while ($featured_page->have_posts()) {
             $featured_page->the_post();
             echo '<div class="' . implode(' ', get_post_class()) . '">';
             if (!empty($instance['show_title'])) {
                 printf('<h4 class="entry-title"><a href="%s" title="%s">%s</a></h4>', get_permalink(), the_title_attribute('echo=0'), get_the_title());
             }
             //Show image
             if (!empty($instance['show_image'])) {
                 printf('<a href="%s" title="%s" class="%s">%s</a>', get_permalink(), the_title_attribute('echo=0'), esc_attr($instance['image_alignment']), calibrefx_get_image(array('format' => 'html', 'size' => $instance['image_size'])));
             }
             if (!empty($instance['show_content'])) {
                 if (empty($instance['content_limit'])) {
                     the_content($instance['more_text']);
                 } else {
                     the_content_limit((int) $instance['content_limit'], esc_html($instance['more_text']));
                 }
             }
             echo '</div><!--end post_class()-->' . "\n\n";
         }
     }
     echo '</div>' . $after_widget;
     wp_reset_query();
 }
开发者ID:alispx,项目名称:calibrefx,代码行数:39,代码来源:feature_page_widget.php

示例5: categori_news

        function categori_news(){
            query_posts('cat=9&showposts=10&posts_per_page=3');

            while (have_posts()) : the_post();
                /*Dima insert*/the_excerpt(); ?>
                <div class="content-box">
                    <div class="bgr01"><div class="bgr02"><div class="bgr03">
                                <div <?php post_class() ?> id="post-<?php the_ID(); ?>" style=" float:none; ">
                                    <div class="title">
                                        <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
                                        <div class="date_all">
                                            <?php the_time('l, j ?F, Y') ?>
                                        </div>
                                        <div class="post">
                                            Написал <?php the_author_link() ?> <?php the_time('g:i A') ?>
                                        </div>
                                    </div>
                                    <div class="content_box">
                                        <?php the_content('Читать всё'); ?>
                                    </div>

                                    <div class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?></div>

                                    <div class="comments"><?php comments_popup_link('0 комментарии', 'комментарии', '% комментарии '); ?></div>
                                    <div class="link-edit"><?php edit_post_link('Edit', ''); ?></div>
                                </div>
                            </div></div></div>
                </div>
            <?php endwhile;}
开发者ID:xronn01,项目名称:www.prosvitcenter.org,代码行数:29,代码来源:myfunk.php

示例6: tf_buddypress

/**
 * Template for BuddyPress pages
 * 
 * @package ThemifyFlow
 * @since 1.0.0
 */
function tf_buddypress()
{
    while (have_posts()) {
        the_post();
        the_content();
    }
}
开发者ID:jhostetter,项目名称:wp_intern_themes,代码行数:13,代码来源:buddypress.php

示例7: widget

        function widget($args, $instance)
        {
            extract($args);
            $ci_post_id = $instance['postid'];
            $post_type_name = $instance['post_type_name'];
            if (empty($ci_post_id) or empty($post_type_name)) {
                return;
            }
            $q = new WP_Query(array('post_type' => $post_type_name, 'p' => $ci_post_id));
            echo $before_widget;
            $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
            while ($q->have_posts()) {
                $q->the_post();
                global $post;
                if (get_post_type() == 'testimonial') {
                    ?>
					<blockquote class="testimonial">
						<i class="fa fa-quote-left"></i>
						<?php 
                    the_content();
                    ?>
						<cite><?php 
                    the_title();
                    ?>
</cite>
					</blockquote>
				<?php 
                } else {
                    ci_get_template_part('loop', 'item', array('title' => $title));
                }
            }
            wp_reset_postdata();
            echo $after_widget;
        }
开发者ID:axxe16,项目名称:bst,代码行数:34,代码来源:ci_widget_post_type.php

示例8: do_x_post_password_cb

 function do_x_post_password_cb()
 {
     //snag from wp-login.php:386-393
     require_once ABSPATH . 'wp-includes/class-phpass.php';
     // By default, use the portable hash from phpass
     $wp_hasher = new PasswordHash(8, true);
     // 10 days
     setcookie('wp-postpass_' . COOKIEHASH, $wp_hasher->HashPassword(stripslashes($_POST['pass'])), time() + 864000, COOKIEPATH);
     //fake it so it's available in the loop below
     $_COOKIE['wp-postpass_' . COOKIEHASH] = $wp_hasher->HashPassword(stripslashes($_POST['pass']));
     $q = new WP_Query("p={$_POST['pid']}");
     if ($q->have_posts()) {
         while ($q->have_posts()) {
             $q->the_post();
             // verifies password hash
             if (post_password_required()) {
                 wp_send_json_error('Invalid password');
             }
             // get post title
             ob_start();
             the_title(sprintf('<a href="%s" rel="bookmark">', esc_url(get_permalink())), '</a>');
             $title = ob_get_clean();
             // get post content
             ob_start();
             the_content();
             $content = ob_get_clean();
         }
     }
     wp_reset_postdata();
     $return = array('title' => $title, 'content' => $content);
     wp_send_json_success($return);
 }
开发者ID:trepmal,项目名称:ajax-password-protected,代码行数:32,代码来源:ajax-password-protected.php

示例9: bizz_post_content_query

/**
 * POST CONTENT - query posts
 *
 * output post content for Query Posts widget, based on predefined arguments
 * @since 7.0
 */
function bizz_post_content_query($args = '', $post_count = false)
{
    global $wp_query, $post, $opt;
    bizz_hook_before_post($post_count);
    #hook
    echo "<" . apply_filters('bizz_html5_section', "div") . " class=\"format_text\">\n";
    $selflink = isset($args['thumb_selflink']) && $args['thumb_selflink'] == true ? true : false;
    $cropp = isset($args['thumb_cropp']) && $args['thumb_cropp'] != '' ? $args['thumb_cropp'] : 'c';
    if (isset($opt['bizzthemes_thumb_show']['value']) && $args['thumb_display']) {
        bizz_image('width=' . $args['thumb_width'] . '&height=' . $args['thumb_height'] . '&class=thumbnail ' . $args['thumb_align'] . '&cropp=' . $cropp . '&selflink=' . $selflink . '&filter=' . $args['thumb_filter'] . '&sharpen=' . $args['thumb_sharpen'] . '');
    }
    if ($args['remove_posts'] == '0') {
        if ($args['full_posts'] == '0' && (is_archive() || $wp_query->is_posts_page || is_search() || is_home())) {
            the_excerpt();
            if ($args['read_more']) {
                echo apply_filters('bizz_read_more', '<span class="read-more"><a href="' . get_permalink() . '" class="url fn" rel="nofollow">' . $args['read_more_text'] . '</a></span>');
            }
        } else {
            the_content($args['read_more_text']);
        }
        wp_link_pages(array('before' => '<div class="page-link">', 'after' => '</div>'));
    }
    echo '<div class="fix"><!----></div>';
    echo "</" . apply_filters('bizz_html5_section', "div") . ">\n";
    bizz_hook_after_post($post_count);
    #hook
}
开发者ID:loevendahl,项目名称:flexbil,代码行数:33,代码来源:frame_html_content.php

示例10: oe_main_slider

function oe_main_slider($numbers = -1)
{
    global $post;
    $query = new WP_Query(array('post_type' => 'slider', 'posts_per_page' => $numbers));
    $imgArray = array();
    if ($query->have_posts()) {
        echo '<div id="header_slider" class="owl-carousel owl-theme">';
        while ($query->have_posts()) {
            $query->the_post();
            $slide_color = get_post_meta($post->ID, 'oe_slider_bg', true);
            ?>
        <div class="item slider-info" style="background-color:<?php 
            echo $slide_color;
            ?>
;">
            <div class="text-slider">
                <?php 
            the_content();
            echo '<a href="#" id="scroll_to"><span class="scroll-down"><span class="img-scroll-down"></span></span>' . __('see what we can do for you.', 'oneengine') . '</a>';
            ?>
            </div>
            <?php 
            the_post_thumbnail('full');
            ?>
        </div>
        
    <?php 
        }
        echo '</div>';
    }
    wp_reset_query();
}
开发者ID:djs11491,项目名称:gallant,代码行数:32,代码来源:template.php

示例11: widget

 /**
  * widget function.
  *
  * @see WP_Widget
  * @access public
  * @param array $args
  * @param array $instance
  * @return void
  */
 function widget($args, $instance)
 {
     if ($this->get_cached_widget($args)) {
         return;
     }
     global $job_manager;
     extract($args);
     if ('' == get_the_content()) {
         return;
     }
     $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
     $icon = isset($instance['icon']) ? $instance['icon'] : null;
     if ($icon) {
         $before_title = sprintf($before_title, 'ion-' . $icon);
     }
     ob_start();
     echo $before_widget;
     remove_filter('the_content', array($job_manager->post_types, 'job_content'));
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     the_content();
     echo $after_widget;
     $content = ob_get_clean();
     echo apply_filters($this->widget_id, $content);
     $this->cache_widget($args, $content);
 }
开发者ID:GaryJones,项目名称:dockerfiles,代码行数:36,代码来源:class-widget-job_listing-content.php

示例12: get_rendered_content

function get_rendered_content()
{
    ob_start();
    the_content();
    $content = ob_get_clean();
    return $content;
}
开发者ID:slaven-ii,项目名称:pecina,代码行数:7,代码来源:functions.php

示例13: display_mega_menu_contents

 static function display_mega_menu_contents($output, $item, $depth, $args)
 {
     $item = (array) $item;
     $args = (array) $args;
     if (empty($args['hide_mega_menu']) && $depth == 0 && $item['object'] == 'ts_mega_menu' && $args['theme_location'] == 'main_nav') {
         $mega_menu_id = $item['object_id'];
         //echo '<pre>'.esc_html(print_r($item, true)).'</pre>'; // debug
         if (!empty($mega_menu_id) && ($mega_menu = get_post($mega_menu_id)) && !is_wp_error($mega_menu)) {
             // We have a mega menu to display.
             $wrapper_classes = apply_filters('ts-mega-menu-classes', array('ts-mega-menu'), $item, $depth, $args);
             global $post;
             $old_post = $post;
             $post = $mega_menu;
             setup_postdata($mega_menu);
             ob_start();
             the_content();
             $contents = ob_get_clean();
             wp_reset_postdata();
             if (!empty($contents)) {
                 $output .= '<ul class="sub-menu ' . esc_attr(implode(' ', $wrapper_classes)) . "\">\n";
                 $output .= '<li class="menu-item ts-mega-menu-wrap">' . "\n";
                 $output .= $contents;
                 $output .= '</li>' . "\n";
                 $output .= "</ul>\n";
             }
             $post = $old_post;
             if (!is_404()) {
                 setup_postdata($post);
             }
         }
     }
     return $output;
 }
开发者ID:estvmachine,项目名称:nicowp,代码行数:33,代码来源:mega-menu.php

示例14: storefront_post_content

    /**
     * Display the post content with a link to the single post
     * @since 1.0.0
     */
    function storefront_post_content()
    {
        ?>
		<?php 
        if (is_search()) {
            ?>
			<div class="entry-summary">
				<h2><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h2>
				<?php 
            the_excerpt();
            ?>
			</div><!-- .entry-summary -->
		<?php 
        } else {
            ?>
			<div class="entry-content" itemprop="articleBody">
				<?php 
            if (has_post_thumbnail()) {
                the_post_thumbnail('full', array('itemprop' => 'image'));
            }
            the_content(sprintf(__('Continue reading %s', 'storefront'), '<span class="screen-reader-text">' . get_the_title() . '</span>'));
            wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'storefront'), 'after' => '</div>'));
            ?>
			</div><!-- .entry-content -->
		<?php 
        }
    }
开发者ID:jasonmcclurg,项目名称:lbm,代码行数:37,代码来源:post.php

示例15: tc_page_content

        /**
         * The template part for displaying page content
         *
         * @package Customizr
         * @since Customizr 3.0
         */
        function tc_page_content() {
            if ( 'page' != tc__f('__post_type') || ! is_singular() || tc__f( '__is_home_empty') )
                return;

            ob_start();

                do_action( '__before_content' );
                ?>

                <div class="entry-content">
                    <?php
                        the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>' , 'customizr' ) );
                        wp_link_pages( array(
                            'before'        => '<div class="btn-toolbar page-links"><div class="btn-group">' . __( 'Pages:' , 'customizr' ),
                            'after'         => '</div></div>',
                            'link_before'   => '<button class="btn btn-small">',
                            'link_after'    => '</button>',
                            'separator'     => '',
                            )
                        );
                    ?>
                </div>

                <?php
                do_action( '__after_content' );

            $html = ob_get_contents();
            if ($html) ob_end_clean();
            echo apply_filters( 'tc_page_content', $html );
        }
开发者ID:niamherinoc,项目名称:rctractors,代码行数:36,代码来源:class-content-page.php


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