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


PHP post_class函数代码示例

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


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

示例1: Page

function Page()
{
    ?>
<div class="article">
  <article id="post-<?php 
    the_ID();
    ?>
" <?php 
    post_class();
    ?>
>
    <?php 
    Page_Header();
    ?>
    <?php 
    Article_Content();
    ?>
    <?php 
    Page_Footer();
    ?>
  </article>
</div>

<?php 
}
开发者ID:gios-asu,项目名称:bemmy-wordpress-theme,代码行数:25,代码来源:Page.php

示例2: widget

    /**
     * Outputs the content for a new widget instance.
     *
     * @see WP_Widget::widget()
     *
     * @param array $args 		Widget arguments.
     * @param array $instance 	Saved values from database.
     */
    function widget($args, $instance)
    {
        extract($args);
        if (isset($instance['page']) && $instance['page'] != -1) {
            $page_id = (int) $instance['page'];
            $p = new WP_Query(array('page_id' => $page_id));
            if ($p->have_posts()) {
                $p->the_post();
                $title = apply_filters('widget_title', empty($instance['title']) ? get_the_title() : $instance['title'], $instance, $this->id_base);
                echo $before_widget;
                echo $before_title;
                echo $title;
                echo $after_title;
                ?>
				<div id="post-<?php 
                the_ID();
                ?>
" <?php 
                post_class();
                ?>
>
						<?php 
                the_content();
                ?>
				</div>

				<?php 
                echo $after_widget;
                wp_reset_postdata();
            }
        }
    }
开发者ID:redweb-tn,项目名称:sx-featured-page-widget,代码行数:40,代码来源:sx-featured-page-widget.php

示例3: Search

function Search()
{
    ?>
<div class="article">
  <article id="post-<?php 
    the_ID();
    ?>
" <?php 
    post_class();
    ?>
>
    <?php 
    Search_Header();
    ?>
    <?php 
    Article_Summary();
    ?>
    <?php 
    Article_Footer();
    ?>
  </article>
</div>

<?php 
}
开发者ID:gios-asu,项目名称:bemmy-wordpress-theme,代码行数:25,代码来源:Search.php

示例4: thesis_teaser

function thesis_teaser($classes, $post_count = false, $right = false)
{
    $classes = 'teaser';
    $post_image = thesis_post_image_info('thumb');
    if ($right) {
        $classes .= ' teaser_right';
    }
    thesis_hook_before_teaser_box($post_count);
    #hook
    ?>
			<div <?php 
    post_class($classes);
    ?>
 id="post-<?php 
    the_ID();
    ?>
">
<?php 
    thesis_build_teaser($post_count, $post_image);
    ?>
			</div>

<?php 
    thesis_hook_after_teaser_box($post_count);
    #hook
    echo $close_box;
}
开发者ID:JGrubb,项目名称:Almond-Tree,代码行数:27,代码来源:teasers.php

示例5: section_template

    function section_template()
    {
        $loop = new fotosPostLoop();
        $artsep = pl_setting('ba_fotos_art_sep');
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                ?>
<article <?php 
                post_class('fotos-article');
                ?>
 id="post-<?php 
                the_ID();
                ?>
" itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost"><?php 
                $loop->post_header();
                $loop->post_content();
                $loop->post_social();
                $loop->post_comments();
                ?>
</article><?php 
                if ($artsep && is_home()) {
                    echo $artsep;
                }
            }
        } else {
            echo 'Sorry no posts found';
        }
    }
开发者ID:adrian-sowinski,项目名称:fotos,代码行数:29,代码来源:section.php

示例6: Article

function Article()
{
    ?>
<div class="article">
  <article id="post-<?php 
    the_ID();
    ?>
" <?php 
    post_class();
    ?>
>
    <?php 
    Article_Header();
    ?>
    <?php 
    if (is_single()) {
        Article_Content();
    } else {
        Article_Continue();
    }
    ?>
  
    <?php 
    Article_Footer();
    ?>
  </article>
</div>

<?php 
}
开发者ID:gios-asu,项目名称:bemmy-wordpress-theme,代码行数:30,代码来源:Article.php

示例7: html5slidefunction

function html5slidefunction($title_slide)
{
    global $post;
    $html5slide_type = get_post_meta($post->ID, 'html5slide_type', true);
    echo '<article ';
    post_class();
    echo '>';
    if ($html5slide_type == 'title_slide') {
        echo '<h1>' . get_the_title() . '</h1>';
        the_content();
    } elseif ($html5slide_type == 'no_title') {
        the_content();
    } elseif ($html5slide_type == 'segue_slide') {
        echo '<h2>' . get_the_title() . '</h2>';
    } else {
        if ($post->post_parent == 0) {
            echo '<h1>' . get_the_title() . '</h1>';
        } else {
            echo '<h3>' . get_the_title() . '</h3>';
        }
        the_content();
    }
    if (isset($GLOBALS['html5presentation_edit'])) {
        edit_post_link('edit slide', '<div class="html5_edit' . $GLOBALS['html5presentation_edit'] . '">', '</div>');
    }
    echo '</article>';
}
开发者ID:WPCMSNinja,项目名称:HTML5-Slideshow-Presentations-WordPress-Plugin,代码行数:27,代码来源:html5-presentation-template.php

示例8: render_content

function render_content()
{
    ?>
	<?php 
    if (have_posts()) {
        ?>
		<div class="loop">
			<div class="loop-content">
				<?php 
        while (have_posts()) {
            // The Loop
            ?>
					<?php 
            the_post();
            ?>
					
					<div id="post-<?php 
            the_ID();
            ?>
" <?php 
            post_class();
            ?>
>
						<!-- title, meta, and date info -->
						<div class="entry-header clearfix">
							<h1 class="entry-title"><?php 
            the_title();
            ?>
</h1>
						</div>
						
						<!-- post content -->
						<div class="entry-content clearfix">
							<?php 
            the_content();
            ?>
						</div>
						
						<?php 
            get_search_form();
            ?>
					</div>
					<!-- end .post -->
				<?php 
        }
        // end of one post
        ?>
			</div>
		</div>
	<?php 
    } else {
        // do not delete
        ?>
		<?php 
        do_action('builder_template_show_not_found');
        ?>
	<?php 
    }
    // do not delete
}
开发者ID:jimrucinski,项目名称:Vine,代码行数:60,代码来源:page_search.php

示例9: 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

示例10: ssm_home_loop

function ssm_home_loop()
{
    ?>

<?php 
    do_action('genesis_before_entry');
    ?>

<article <?php 
    post_class();
    ?>
 itemscope="itemscope" itemtype="http://schema.org/CreativeWork">

	<div class="entry-content" itemprop="text">

		<?php 
    include 'templates/includes/content-blocks.php';
    ?>

	</div>
	<!-- entry-content -->

</article>

<?php 
    do_action('genesis_after_entry');
    ?>

<?php 
}
开发者ID:Wordpress-Development,项目名称:genesis-foundation,代码行数:30,代码来源:front-page.php

示例11: rb_portfolio_loop_content

function rb_portfolio_loop_content()
{
    if (have_posts()) {
        add_thickbox();
        while (have_posts()) {
            the_post();
            ?>

			<article <?php 
            post_class();
            ?>
>

    		<?php 
            rb_portfolio_add_image();
            //rb_portfolio_featured_post_image();
            the_date('F Y', '<span class="portfolio-date">', '</span>');
            genesis_do_post_title();
            rb_portfolio_add_authors();
            rb_portfolio_display_thickbox_content();
            ?>

    		</article>

			<?php 
        }
    }
}
开发者ID:redblueconcepts,项目名称:redblue-portfolio,代码行数:28,代码来源:archive-portfolio.php

示例12: cases_display_childs_cp

function cases_display_childs_cp()
{
    global $post;
    $query = new WP_Query('post_type=cases&post_parent=' . $post->ID);
    if (!is_singular('cases')) {
        return;
    }
    ?>
	<section id="person_dossier" class="cases-box">
		<header class="cases-box-header">
	    	<h1>Досье</h1>
	    	<hr>
		</header>
		<article class="cases-box-content">
            <ul>
			<?php 
    while ($query->have_posts()) {
        $query->the_post();
        ?>
            <li role="article" id="post-<?php 
        the_ID();
        ?>
" <?php 
        post_class();
        ?>
>
                <header class="entry-header">
                    <a href="<?php 
        the_permalink();
        ?>
">
                        <h2 class="entry-title"><?php 
        the_title();
        ?>
</h2>
                    </a>
                </header>
                <section id='meta-case'>
                    <ul class="list-inline">
                        <?php 
        do_action('case_meta_top_add_li');
        ?>
                    </ul> 
                </section>
                
            </li><!-- #post-<?php 
        the_ID();
        ?>
 -->    

            <?php 
    }
    wp_reset_postdata();
    ?>
            </ul>
		</article>
	</section>
<?php 
}
开发者ID:Laxiston,项目名称:casepress,代码行数:59,代码来源:dossier.php

示例13: widget

    /** @see WP_Widget::widget -- do not rename this */
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $link = $instance['link'];
        $textarea = wpautop($instance['textarea']);
        $count = 0;
        echo $before_widget;
        if ($title) {
            echo '<header>';
            echo '<h4 class="widget-title widgettitle portfolio-widget-title">';
            echo $title;
            echo '</h4>';
            echo '</header>';
        }
        if ($textarea) {
            echo '<div class="entry-widget_content entry-content portfolio-widget-content">';
            echo $textarea;
            echo '</div>';
        }
        if (have_posts()) {
            echo '<div class="full-width-content post-type-archive-portfolio">';
            add_thickbox();
            $args = array('post_type' => 'portfolio', 'posts_per_page' => '4');
            $portfolio_query = new WP_Query($args);
            while ($portfolio_query->have_posts()) {
                $portfolio_query->the_post();
                $add_class = array('one-fourth');
                if ($count == 0 || $count == 4) {
                    $add_class[] = 'first';
                    echo '<div class="clear"></div>';
                }
                ?>
            <article <?php 
                post_class($add_class);
                ?>
>

               <?php 
                rb_portfolio_add_image();
                // the_date( 'F Y', '<span class="portfolio-date">', '</span>' );
                genesis_do_post_title();
                // rb_portfolio_add_authors();
                rb_portfolio_display_thickbox_content();
                ?>

            </article>

            <?php 
                $count++;
            }
        }
        wp_reset_query();
        echo '<div class="clear"></div>';
        echo '</div>';
        // .full-width-content.post-type-archive-portfolio
        echo $after_widget;
    }
开发者ID:redblueconcepts,项目名称:redblue-portfolio,代码行数:59,代码来源:widget-grid.php

示例14: widget

    function widget($args, $instance)
    {
        extract($args, EXTR_SKIP);
        global $icon;
        $icon = $instance['icon'];
        $title = apply_filters('widget_title', $instance['title']);
        $number = $instance['number'];
        /* before widget */
        echo $before_widget;
        /* display title */
        if ($title && $icon) {
            echo $before_title . '<i class="fa ' . $icon . ' "></i>' . $title . $after_title;
        } elseif ($title) {
            echo $before_title . $title . $after_title;
        }
        /* display the widget */
        ?>
						
		<div <?php 
        post_class();
        ?>
 id="images-widget-<?php 
        the_ID();
        ?>
">
                        
                        <div class="gallery-widget">
                        
                        <ul>
                        <?php 
        global $post;
        $args = array('order' => 'DESC', 'post_type' => 'gallery', 'posts_per_page' => 1);
        $loop = new WP_Query($args);
        while ($loop->have_posts()) {
            $loop->the_post();
            $images = rwmb_meta('gxg_gallery_images', 'type=image&size=square2', false);
            $i = 0;
            foreach ($images as $image) {
                $imageurl = $image['url'];
                $imagefull = $image['full_url'];
                if ($i++ < $number) {
                    echo "<li class='prettyimage-wrap'><a class='pretty_image' title='' data-rel='prettyPhoto[pp_gallery]' href='{$imagefull}'><span class='image-rollover'><i class='gallery-resize-icon fa fa-expand'></i></span><img src='{$imageurl}' alt='' /></a></li>";
                }
            }
        }
        wp_reset_query();
        ?>
                
                        </ul>
                        </div><!-- .gallery-widget --> 
                        </div><!-- .post-? --> 
		
                <?php 
        /* after widget */
        echo $after_widget;
    }
开发者ID:m-godefroid76,项目名称:devrestofactory,代码行数:56,代码来源:widget-images.php

示例15: widget

    public function widget($args, $instance)
    {
        if (!isset($args['widget_id'])) {
            $args['widget_id'] = $this->id;
        }
        $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
        $number = !empty($instance['number']) ? absint($instance['number']) : 5;
        if (!$number) {
            $number = 5;
        }
        $args_article = array('posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'order' => $instance['order'], 'orderby' => $instance['orderby']);
        if (is_array($instance['category'])) {
            $args_article['category__in'] = $instance['category'];
        }
        $r = new WP_Query(apply_filters('widget_posts_args', $args_article));
        if ($r->have_posts()) {
            echo $args['before_widget'];
            if ($title) {
                echo $args['before_title'] . $title . $args['after_title'];
            }
            ?>
            <ul class="kt_posts_carousel_widget">
                <?php 
            while ($r->have_posts()) {
                $r->the_post();
                ?>
                    <li <?php 
                post_class('article-widget clearfix');
                ?>
>
                        <?php 
                kt_post_thumbnail_image('kt_widget_article_carousel', 'img-responsive');
                ?>
                        <div class="article-attr">
                            <h3 class="title">
                                <a href="<?php 
                the_permalink();
                ?>
">
                                    <?php 
                get_the_title() ? the_title() : the_ID();
                ?>
                                </a>
                            </h3>
                        </div>
                    </li>
                <?php 
            }
            ?>
            </ul>
            <?php 
            echo $args['after_widget'];
            wp_reset_postdata();
        }
    }
开发者ID:websideas,项目名称:aquila,代码行数:55,代码来源:kt_article_carousel.php


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