محتویات فایل content.php یا ممکن است content-aside.php یا .. در پوشه قالب باشد را قرار دهید.
ویرایش توسط T.Toosi : September 26th, 2016 در ساعت 22:49
این content.php
<?php
/**
* The default template for displaying content
*
* Used for both single and index/archive/search.
*
* @package WordPress
* @subpackage timeplus_Themes
* @since Road Themes 1.0
*/
$timeplus_opt = get_option( 'timeplus_opt' );
$timeplus_postthumb = TimePlus::timeplus_post_thumbnail_size('');
if(TimePlus::timeplus_post_odd_event() == 1){
$timeplus_postclass='even';
} else {
$timeplus_postclass='odd';
}
?>
<article id="post-<?php the_ID(); ?>" <?php post_class($timeplus_postclass); ?>>
<?php if ( ! post_password_required() && ! is_attachment() ) : ?>
<?php
if ( is_single() ) { ?>
<?php if ( has_post_thumbnail() ) { ?>
<div class="post-thumbnail"><?php the_post_thumbnail(); ?></div>
<?php } ?>
<?php }
?>
<?php if ( !is_single() ) { ?>
<?php if ( has_post_thumbnail() ) { ?>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail($timeplus_postthumb); ?></a>
</div>
<?php } ?>
<?php } ?>
<?php endif; ?>
<div class="postinfo-wrapper <?php if ( !has_post_thumbnail() ) { echo 'no-thumbnail';} ?>">
<div class="post-info">
<header class="entry-header">
<div class="post-date">
<?php echo '<span class="day">'.get_the_date('d', $post->ID).'</span><span class="month">'.get_the_date('M', $post->ID).'</span>' ;?>
</div>
<?php if ( is_single() ) : ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php else : ?>
<h1 class="entry-title">
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
</h1>
<?php endif; ?>
</header>
<footer class="entry-meta-small">
<?php TimePlus::timeplus_entry_meta_small(); ?>
</footer>
<?php if ( is_single() ) : ?>
<div class="entry-content">
<?php the_content( esc_html__( 'Continue reading <span class="meta-nav">→</span>', 'timeplus' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'timeplus' ), 'after' => '</div>', 'pagelink' => '<span>%</span>' ) ); ?>
</div>
<?php else : ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div>
<a class="readmore" href="<?php the_permalink(); ?>"><?php if(isset($timeplus_opt['readmore_text']) && $timeplus_opt['readmore_text']!=''){ echo esc_html($timeplus_opt['readmore_text']); } else { esc_html_e('Read more', 'timeplus');} ?></a>
<?php endif; ?>
<?php if ( is_single() ) : ?>
<div class="entry-meta">
<?php TimePlus::timeplus_entry_meta(); ?>
</div>
<?php if( function_exists('timeplus_blog_sharing') ) { ?>
<div class="social-sharing"><?php timeplus_blog_sharing(); ?></div>
<?php } ?>
<div class="author-info">
<div class="author-avatar">
<?php
$author_bio_avatar_size = apply_filters( 'roadthemes_author_bio_avatar_size', 68 );
echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size );
?>
</div>
<div class="author-description">
<h2><?php esc_html_e( 'درباره نویسنده: ', 'timeplus'); printf( '<a href="'.esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ).'" rel="author">%s</a>' , get_the_author()); ?></h2>
<p><?php the_author_meta( 'description' ); ?></p>
</div>
</div>
<?php endif; ?>
</div>
</div>
</article>
در ظاهر که مشکلی نیست و داره the_excerpt() یا همون چکیده رو نشون میده، ممکن هست مشکلی در function قالب باشد یا .. باشد که باید بررسی شود، به هر حال کد زیرا جایگزین کنید و تست کنید :
کد PHP:
<?php
/**
* The default template for displaying content
*
* Used for both single and index/archive/search.
*
* @package WordPress
* @subpackage timeplus_Themes
* @since Road Themes 1.0
*/
$timeplus_opt = get_option( 'timeplus_opt' );
$timeplus_postthumb = TimePlus::timeplus_post_thumbnail_size('');
if(TimePlus::timeplus_post_odd_event() == 1){
$timeplus_postclass='even';
} else {
$timeplus_postclass='odd';
}
?>
<article id="post-<?php the_ID(); ?>" <?php post_class($timeplus_postclass); ?>>
<?php if ( ! post_password_required() && ! is_attachment() ) : ?>
<?php
if ( is_single() ) { ?>
<?php if ( has_post_thumbnail() ) { ?>
<div class="post-thumbnail"><?php the_post_thumbnail(); ?></div>
<?php } ?>
<?php }
?>
<?php if ( !is_single() ) { ?>
<?php if ( has_post_thumbnail() ) { ?>
<div class="post-thumbnail">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail($timeplus_postthumb); ?></a>
</div>
<?php } ?>
<?php } ?>
<?php endif; ?>
<div class="postinfo-wrapper <?php if ( !has_post_thumbnail() ) { echo 'no-thumbnail';} ?>">
<div class="post-info">
<header class="entry-header">
<div class="post-date">
<?php echo '<span class="day">'.get_the_date('d', $post->ID).'</span><span class="month">'.get_the_date('M', $post->ID).'</span>' ;?>
</div>
<?php if ( is_single() ) : ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php else : ?>
<h1 class="entry-title">
<a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
</h1>
<?php endif; ?>
</header>
<footer class="entry-meta-small">
<?php TimePlus::timeplus_entry_meta_small(); ?>
</footer>
<?php if ( is_single() ) : ?>
<div class="entry-content">
<?php the_content( esc_html__( 'Continue reading <span class="meta-nav">→</span>', 'timeplus' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'timeplus' ), 'after' => '</div>', 'pagelink' => '<span>%</span>' ) ); ?>
</div>
<?php else : ?>
<div class="entry-summary">
<?php
$excerpt = explode(' ', get_the_excerpt(), 50);
if (count($excerpt)>=50) {
array_pop($excerpt);
$excerpt = implode(" ",$excerpt).'...';
} else {
$excerpt = implode(" ",$excerpt);
}
$excerpt = preg_replace('`[[^]]*]`','',$excerpt);
echo $excerpt;
?>
</div>
<a class="readmore" href="<?php the_permalink(); ?>"><?php if(isset($timeplus_opt['readmore_text']) && $timeplus_opt['readmore_text']!=''){ echo esc_html($timeplus_opt['readmore_text']); } else { esc_html_e('Read more', 'timeplus');} ?></a>
<?php endif; ?>
<?php if ( is_single() ) : ?>
<div class="entry-meta">
<?php TimePlus::timeplus_entry_meta(); ?>
</div>
<?php if( function_exists('timeplus_blog_sharing') ) { ?>
<div class="social-sharing"><?php timeplus_blog_sharing(); ?></div>
<?php } ?>
<div class="author-info">
<div class="author-avatar">
<?php
$author_bio_avatar_size = apply_filters( 'roadthemes_author_bio_avatar_size', 68 );
echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size );
?>
</div>
<div class="author-description">
<h2><?php esc_html_e( 'درباره نویسنده: ', 'timeplus'); printf( '<a href="'.esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ).'" rel="author">%s</a>' , get_the_author()); ?></h2>
<p><?php the_author_meta( 'description' ); ?></p>
</div>
</div>
<?php endif; ?>
</div>
</div>
</article>
ویرایش توسط T.Toosi : September 26th, 2016 در ساعت 23:54
بیا تو هاست | سرور اختصاصی-مجازی-هاست-پنل پیامک
تلگرام نظامی فر: @ALiNezamifarDotCom
واتس آپ / تماس / پیامک :09365677482
ببین تو این قسمت از کدت
داره یه تمپلیت ایمپورت می کنه نیاز به دسترسی هاستت هست . اینطوری نمیشه کاریش کرد .کد PHP:
<?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?>
بیا تو هاست | سرور اختصاصی-مجازی-هاست-پنل پیامک
تلگرام نظامی فر: @ALiNezamifarDotCom
واتس آپ / تماس / پیامک :09365677482
اطلاعات هاستت رو خصوصی بفرست .
بیا تو هاست | سرور اختصاصی-مجازی-هاست-پنل پیامک
تلگرام نظامی فر: @ALiNezamifarDotCom
واتس آپ / تماس / پیامک :09365677482
در حال حاضر 1 کاربر در حال مشاهده این موضوع است. (0 کاربران و 1 مهمان ها)