سلام دوستان وقت بخیر
توی قالب من مشکل ضمیمه زیر رو دارم
http://uupload.ir/files/w2us_capture.jpg
هرکار میکنم متن کامل روی صفحه اصلی میاد
من میخام متن روی صفحه اصلی نیاد و یا اگه میاد فقط مختصری از توضیحات بیاد
نمایش نسخه قابل چاپ
سلام دوستان وقت بخیر
توی قالب من مشکل ضمیمه زیر رو دارم
http://uupload.ir/files/w2us_capture.jpg
هرکار میکنم متن کامل روی صفحه اصلی میاد
من میخام متن روی صفحه اصلی نیاد و یا اگه میاد فقط مختصری از توضیحات بیاد
خواهشا یکی ج منو بده:(
توی توضیحات وردپرستون از more استفاده کنید
اگه لازمه فایل index رو بذارم ببینید؟
نمونه بهم بدید ببینم
سلام جایی که کد زیر هست رو پیدا کنید و اگر عکس بگیرید یا 5 خط قبل و بعدش رو بنویسید میشه راهنمایی کرد
<?php the_content(); ?>
احتمالا در صفحه index.php باید باشد
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* For example, it puts together the home page when no home.php file exists.
*
* @link http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage timeplus_Themes
* @since Road Themes 1.0
*/
$timeplus_opt = get_option( 'timeplus_opt' );
get_header();
if(isset($timeplus_opt) && $timeplus_opt['blog_layout']=='nosidebar'){
$bloglayout = 'nosidebar';
} else {
$bloglayout = 'sidebar';
}
if(isset($timeplus_opt['blog_layout']) && $timeplus_opt['blog_layout']!=''){
$bloglayout = $timeplus_opt['blog_layout'];
}
if(isset($_GET['layout']) && $_GET['layout']!=''){
$bloglayout = $_GET['layout'];
}
$blogsidebar = 'right';
if(isset($timeplus_opt['sidebarblog_pos']) && $timeplus_opt['sidebarblog_pos']!=''){
$blogsidebar = $timeplus_opt['sidebarblog_pos'];
}
if(isset($_GET['sidebar']) && $_GET['sidebar']!=''){
$blogsidebar = $_GET['sidebar'];
}
switch($bloglayout) {
case 'sidebar':
$blogclass = 'blog-sidebar';
$blogcolclass = 9;
TimePlus::timeplus_post_thumbnail_size('james-category-thumb');
break;
default:
$blogclass = 'blog-nosidebar';
$blogcolclass = 12;
$blogsidebar = 'none';
TimePlus::timeplus_post_thumbnail_size('james-post-thumb');
}
?>
<div class="main-container">
<div class="container">
<?php TimePlus::timeplus_breadcrumb(); ?>
<header class="entry-header">
<h1 class="entry-title"><?php if(isset($timeplus_opt)) { echo esc_html($timeplus_opt['blog_header_text']); } else { esc_html_e('Blog', 'timeplus');} ?></h1>
</header>
<div class="row">
<?php if($blogsidebar=='left') : ?>
<?php get_sidebar(); ?>
<?php endif; ?>
<div class="col-xs-12 <?php echo 'col-md-'.$blogcolclass; ?>">
<div class="page-content blog-page <?php echo esc_attr($blogclass); if($blogsidebar=='left') {echo ' left-sidebar'; } if($blogsidebar=='right') {echo ' right-sidebar'; } ?>">
<?php if ( have_posts() ) : ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php TimePlus::timeplus_pagination(); ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<?php if ( current_user_can( 'edit_posts' ) ) :
// Show a different message to a logged-in user who can add posts.
?>
<header class="entry-header">
<h1 class="entry-title"><?php esc_html_e( 'No posts to display', 'timeplus' ); ?></h1>
</header>
<div class="entry-content">
<p><?php printf( esc_html__( 'Ready to publish your first post? <a href="%s">Get started here</a>.', 'timeplus' ), admin_url( 'post-new.php' ) ); ?></p>
</div><!-- .entry-content -->
<?php else :
// Show the default message to everyone else.
?>
<header class="entry-header">
<h1 class="entry-title"><?php esc_html_e( 'Nothing Found', 'timeplus' ); ?></h1>
</header>
<div class="entry-content">
<p><?php esc_html_e( 'Apologies, but no results were found. Perhaps searching will help find a related post.', 'timeplus' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
<?php endif; // end current_user_can() check ?>
</article><!-- #post-0 -->
<?php endif; // end have_posts() check ?>
</div>
</div>
<?php if( $blogsidebar=='right') : ?>
<?php get_sidebar(); ?>
<?php endif; ?>
</div>
</div>
<?php if(isset($timeplus_opt['display_bottom_block']) && $timeplus_opt['display_bottom_block']) { ?>
<div class="bottom-block-wrapper">
<div class="container">
<?php if(isset($timeplus_opt['bottom_block']) && $timeplus_opt['bottom_block']!=''){ ?>
<div class="bottom-block">
<?php echo wp_kses($timeplus_opt['bottom_block'], array(
'a' => array(
'href' => array(),
'title' => array()
),
'img' => array(
'src' => array(),
'alt' => array()
),
'ul' => array(),
'li' => array(),
'i' => array(
'class' => array()
),
'div' => array(
'class' => array(),
),
'br' => array(),
'em' => array(),
'strong' => array(),
'span' => array(
'class' => array(),
),
'h4' => array(
'class' => array(),
),
'p' => array(
'class' => array(),
),
)); ?>
</div>
<?php } ?>
<!-- end bottom-block -->
<?php if(isset($timeplus_opt['bottom_shortcode']) && $timeplus_opt['bottom_shortcode']!=''){ ?>
<div class="shortcode carousel-middle">
<?php echo do_shortcode($timeplus_opt['bottom_shortcode']);?>
</div>
<?php } ?>
<!-- end shortcode -->
</div>
</div>
<?php } ?>
</div>
<?php get_footer(); ?>
این کد index
کدوم متن رو میگید؟
محتویات فایل content.php یا ممکن است content-aside.php یا .. در پوشه قالب باشد را قرار دهید.
این 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>
ببین تو این قسمت از کدت
داره یه تمپلیت ایمپورت می کنه نیاز به دسترسی هاستت هست . اینطوری نمیشه کاریش کرد .کد PHP:
<?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?>
اطلاعات هاستت رو خصوصی بفرست .
نمیدونم اینجا گذاشتن اینطور چیزا مجاز هست یا نه .
ایدی تلگرام : @ALiNezamifarDotCom
(آی دی قبلیم بسته شده)
دوستان مشکل من هنوز حل نشده
یکی نیست راه حلی بگه؟
صفحه اصلیم هم ووکامرسه
برای راهنمایی های بیشتر اسم قالبتون رو بگید
در قسمت نوشته ها در بالای سمت چپ گزینه ای هست به اسم تنظیمات
از اون قسمت چکیده رو فعال کنید و قسمت چکیده رو پر کنید حل میشه مشکلتون