انجمن


تنظیم های بایگانی های ماهانه و موضوعی  (۳ نوشته)

  • khodemani

    آفلاین
    عضو
    تعداد نوشته‌ها: ۶۸
    تشکر شده: ۱۰ بار
    # نوشته شده: ۱۴ سال پیش
    ۱ خرداد ۱۳۸۸ - ۲۳:۳۱

    در بایگانی ماهانه و موضوعی بعضی از پوسته ها (و حتی در نتایج جستجو) فقط عنوان پست نشان داده می شود و خلاصه ای از پست ها نشان داده نمی شود.
    باید چه تگ هایی را و در کجا اضافه کرد که چند خط از پست در زیر عنوان دیده شود.
    با تشکر

  • Morteza

    آفلاین
    ناظم
    تعداد نوشته‌ها: ۳۴۰۲
    تشکر شده: ۳۱۲۸ بار
    # نوشته شده: ۱۴ سال پیش
    ۲ خرداد ۱۳۸۸ - ۱۱:۴۱

    خوب از excerpt توی اون بخش با محدودیت تعداد کاراکتر استفاده کن:
    <?php the_excerpt(''); ?>
    با محدودیت
    <?php echo substr(get_the_excerpt(),0,350); ?>

  • khodemani

    آفلاین
    عضو
    تعداد نوشته‌ها: ۶۸
    تشکر شده: ۱۰ بار
    # نوشته شده: ۱۴ سال پیش
    ۳ خرداد ۱۳۸۸ - ۰۲:۵۲

    در فایل archive چیزی با اسم excerpt نیست. آیا لازم است که اول ایجاد شود و بعد آنطور که گفتید، تنظیم شود؟ اگر باید اضافه شود در کدام خط اضافه کنم؟ این شکل فایل آرشیو است:
    a blockquote br code em strong ul ol li
    backticks
    ?php get_header(); ?>

    <div id="content" class="narrowcolumn">

    <?php if (have_posts()) : ?>

    <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    <?php /* If this is a category archive */ if (is_category()) { ?>
    <h2>بایگانی برای دسته ‘<?php single_cat_title(); ?>’</h2>
    <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
    <h2>نوشته‌های برچسب شده با ‘<?php single_tag_title(); ?>’</h2>
    <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    <h2>بایگانی برای <?php the_time('j F Y'); ?></h2>
    <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    <h2>بایگانی برای <?php the_time('F Y'); ?></h2>
    <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    <h2>بایگانی برای <?php the_time('Y'); ?></h2>
    <?php /* If this is an author archive */ } elseif (is_author()) { ?>
    <h2>بایگانی نویسنده</h2>
    <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    <h2>بایگانی وبگاه</h2>
    <?php } ?>

    <?php if ( is_paged() || count($posts) >= get_option('posts_per_page') ) : ?>
    <div class="post_meta archive_pagination">

    <div class="left"><?php next_posts_link('« نوشته‌های پیشین') ?></div>
    <div class="right"><?php previous_posts_link('نوشته‌های بعدی »') ?></div>

    <div class="clearer"> </div>

    </div>

    <?php else : ?>
    <div class="content_separator"></div>

    <?php endif;?>

    <?php while (have_posts()) : the_post(); ?>

    <div class="archive_post">

    <div class="archive_post_date">
    <div class="archive_post_day"><?php the_time('j') ?></div>
    <div class="archive_post_month"><?php the_time('F Y'); ?></div>
    </div>

    <div class="archive_post_title">
    <h3 id="post-<?php the_ID(); ?>">
    " rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>" style="text-decoration: none"><?php the_title(); ?></h3>
    <div class="post_date">دسته: <?php the_category(', ') ?> | <?php comments_popup_link('بدون دیدگاه »', '1 دیدگاه »', '% دیدگاه »'); ?></div>
    </div>

    <div class="clearer"> </div>

    </div>

    <?php endwhile; ?>

    <?php if ( is_paged() || count($posts) >= get_option('posts_per_page') ) : ?>

    <div class="post_meta archive_pagination">

    <div class="left"><?php next_posts_link('« نوشته‌های پیشین') ?></div>
    <div class="right"><?php previous_posts_link('نوشته‌های بعدی »') ?></div>

    <div class="clearer"> </div>

    </div>

    <?php endif;?>

    <?php else : ?>
    <p>پیدا نشد.</p>

    <?php endif; ?>

    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>
    backticks

درباره‌ی این موضوع



برچسب‌ها

هیچ برچسبی نیست.