本文整理汇总了PHP中post_class函数的典型用法代码示例。如果您正苦于以下问题:PHP post_class函数的具体用法?PHP post_class怎么用?PHP post_class使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了post_class函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: widget
function widget($args, $instance)
{
extract($args);
$instance = wp_parse_args((array) $instance, array('title' => '', 'posts_cat' => '', 'posts_num' => '', 'posts_offset' => '', 'orderby' => '', 'order' => '', 'show_image' => 0, 'image_alignment' => '', 'image_size' => '', 'show_title' => 0, 'show_byline' => 0, 'show_content' => 0, 'content_limit' => '', 'more_text' => ''));
echo $before_widget;
$featured_posts = new WP_Query(array('cat' => $instance['posts_cat'], 'showposts' => $instance['posts_num'], 'offset' => $instance['posts_offset'], 'orderby' => $instance['orderby'], 'order' => $instance['order']));
if ($featured_posts->have_posts()) {
while ($featured_posts->have_posts()) {
$featured_posts->the_post();
echo '<li ';
post_class('feature-post');
echo '>';
if (!empty($instance['show_image'])) {
echo '<a href="' . get_permalink() . '" title="' . get_the_title() . '" class="' . esc_attr($instance['image_alignment']) . ' feature-image">';
genesis_image(array('format' => 'html', 'size' => $instance['image_size']));
echo '</a>';
}
if (!empty($instance['show_title'])) {
echo '<h2 class="title"><a href="' . get_permalink() . '" title="' . esc_attr(get_the_title()) . '">' . get_the_title() . '</a></h2>';
}
if (!empty($instance['show_byline'])) {
echo '<p class="byline">';
the_time('F j, Y');
echo ' ' . __('by', 'genesis') . ' ';
the_author_posts_link();
echo ' · ';
comments_popup_link(__('Leave a Comment', 'genesis'), __('1 Comment', 'genesis'), __('% Comments', 'genesis'));
echo ' ';
edit_post_link(__('(Edit)', 'genesis'), '', '');
echo '</p>';
}
if (!empty($instance['show_content'])) {
if ($instance['show_content'] == 'excerpt') {
the_excerpt();
} elseif ($instance['show_content'] == 'content-limit') {
the_content_limit((int) $instance['content_limit'], esc_html($instance['more_text']));
} else {
the_content(esc_html($instance['more_text']));
}
}
echo '</li><!--end post_class()-->' . "\n\n";
if (!empty($instance['show_slider_nav'])) {
$slider_nav .= '<li><a href="#"></a></li>';
}
}
}
echo $after_widget;
echo '<div class="feature-nav ' . esc_attr($instance['image_alignment']) . '">';
echo '<ul>';
echo $slider_nav;
echo '</ul></div>';
wp_reset_query();
}
开发者ID:nmrugg,项目名称:studiopress-premum-wp-themes,代码行数:53,代码来源:lexicon-slider-widget.php
示例17: actions_post_content
/**
* Display the post content with a link to the single post
* @since 1.0.0
*/
function actions_post_content()
{
if (is_search()) {
?>
<header class="page-header">
<h1 class="page-title"><?php
printf(__('Search Results for: %s', 'actions'), '<span>' . esc_html(get_search_query()) . '</span>');
?>
</h1>
</header><!-- .page-header -->
<?php
}
while (have_posts()) {
the_post();
?>
<article id="post-<?php
the_ID();
?>
" <?php
post_class();
?>
>
<?php
actions_post_header();
?>
<div class="entry-content">
<?php
actions_post_thumbnail('full');
if ('post' == get_post_type()) {
?>
<div class="entry-meta">
<?php
actions_posted_on();
?>
</div>
<?php
}
if (is_search()) {
the_excerpt();
} else {
the_content(sprintf(__('Continue reading %s', 'actions'), '<span class="screen-reader-text">' . esc_url(get_the_title()) . '</span>'));
}
wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'actions'), 'after' => '</div>'));
//actions_entry_footer();
?>
</div><!-- .entry-content -->
</article><!-- #post-## -->
<?php
}
}
开发者ID:WPDevHQ,项目名称:actions,代码行数:57,代码来源:post.php
示例18: gencwooc_single_product_loop
/**
* Displays single product loop
*
* Uses WooCommerce structure and contains all existing WooCommerce hooks
*
* Code based on WooCommerce 1.5.5 woocommerce_single_product_content()
* @see woocommerce/woocommerce-template.php
*
* @since 0.9.0
*/
function gencwooc_single_product_loop()
{
do_action('woocommerce_before_main_content');
// Let developers override the query used, in case they want to use this function for their own loop/wp_query
$wc_query = false;
// Added a hook for developers in case they need to modify the query
$wc_query = apply_filters('gencwooc_custom_query', $wc_query);
if (!$wc_query) {
global $wp_query;
$wc_query = $wp_query;
}
if ($wc_query->have_posts()) {
while ($wc_query->have_posts()) {
$wc_query->the_post();
?>
<?php
do_action('woocommerce_before_single_product');
?>
<div itemscope itemtype="http://schema.org/Product" id="product-<?php
the_ID();
?>
" <?php
post_class();
?>
>
<?php
do_action('woocommerce_before_single_product_summary');
?>
<div class="summary">
<?php
do_action('woocommerce_single_product_summary');
?>
</div>
<?php
do_action('woocommerce_after_single_product_summary');
?>
</div>
<?php
do_action('woocommerce_after_single_product');
}
}
do_action('woocommerce_after_main_content');
}
开发者ID:tleonard2,项目名称:durablegbFeb,代码行数:62,代码来源:single-product.php
示例19: featured_post_class
/**
* Add an "active" class to the first carousel item.
*/
function featured_post_class($class = '', $post_id = null)
{
global $featured;
if ($class) {
$class .= ' ';
}
if ($featured->current_post === 0) {
$class .= 'active';
return post_class($class, $post_id);
} else {
return post_class($class, $post_id);
}
}
开发者ID:snorri1090,项目名称:sixweekgeek,代码行数:16,代码来源:extras.php
示例20: themerex_wrapper_start
function themerex_wrapper_start()
{
$blog_style = 'fullpost';
//get_custom_option('blog_style');
$post_format = 'standard';
?>
<article <?php
post_class('theme_article post_format_' . $post_format);
?>
>
<div class="post_content">
<?php
}
开发者ID:nickandersonr,项目名称:FriedMagazine,代码行数:13,代码来源:type-woocommerce.php
注:本文中的post_class函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论