• Вот в чем проблема, хочу на блоге сделать вывод описаний категорий перед постами этой категории как тут
    есть код вывода данной функции

    <?php
    if(is_category(23)) {include('wp-content/descript/3.txt'); }//Консервация
    if(is_category(22)) {include('wp-content/descript/5.txt'); }//Овощи
    if(is_category(17)) {include('wp-content/descript/7.txt'); }//Роллы
    if(is_category(19)) {include('wp-content/descript/10.txt'); }//Суши
    if(is_category(21)) {include('wp-content/descript/1.txt'); }//Вторые блюда
    if(is_category(13)) {include('wp-content/descript/2.txt'); }// История Японии
    if(is_category(14)) {include('wp-content/descript/6.txt'); }//Рецепты пирогов
    if(is_category(24)) {include('wp-content/descript/8.txt'); }//Салаты
    */?>

    Как мне объяснили его нужно вставлять в архивы.пхп
    вот мой

    <?php get_header(); ?>	<!-- BEGIN MAIN WRAPPER -->
    	<div id="main-wrapper">
    
    		<!-- BEGIN MAIN -->
    		<div id="main">
    
    			<div id="archive-wrapper">
    
    	<?php
    if(is_category(74)) {include('wp-content/descript/1.txt');}//Assassins Creed
     */?>
    
    	<?php if (have_posts()) : ?>
    
    	<?php /* Get author data */
    	if(get_query_var('author_name')) :
    	$curauth = get_userdatabylogin(get_query_var('author_name'));
    	else :
    	$curauth = get_userdata(get_query_var('author'));
    	endif;
    	?>
    
    	<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    	<?php /* If this is a category archive */ if (is_category()) { ?>
    
    	<h3 class="section-title">Category:  <?php single_cat_title(); ?></h3>
    	<?php /* If this is a tag archive */ } elseif( is_tag() ) { ?>
    	<h3 class="section-title">Tagged:  <?php single_tag_title(); ?></h3>
    	<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    	<h3 class="section-title">Archive:  <?php the_time('F jS, Y'); ?></h3>
    	<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    	<h3 class="section-title">Archive:  <?php the_time('F, Y'); ?></h3>
    	<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    	<h3 class="section-title">Archive:  <?php the_time('Y'); ?></h3>
    	<?php /* If this is an author archive */ } elseif (is_author()) { ?>
    	<h3 class="section-title">All Posts by: <?php echo $curauth->display_name; ?></h3>
    
    	<?php } ?>
    
    	<?php $i = 1; ?>
    
    	<?php while (have_posts()) : the_post(); ?>
    
    		<?php
    
    			if ( get_post_type() == 'reviews' ) : ?>
    
    				<?php include( TEMPLATEPATH . '/includes/show-reviews-frontpage.php' ); ?>
    
    			<?php elseif ( get_post_type() == 'videos' ) : ?>
    
    				<?php include( TEMPLATEPATH . '/includes/show-videos-frontpage.php' ); ?>
    
    			<?php elseif ( get_post_type() == 'screenshots' ) : ?>
    
    				<?php include( TEMPLATEPATH . '/includes/show-screenshots-frontpage.php' ); ?>
    
    			<?php else:	?>
    
    				<?php include( TEMPLATEPATH . '/includes/show-posts.php' ); ?>
    
    			<?php endif; ?>
    
    	<?php endwhile; ?>
    
    			</div>
    
    			<div class="pagination-fix"></div>
    			<?php kriesi_pagination(); ?>
    
    	<?php else :
    
    		if ( is_category() ) { // If this is a category archive
    				printf(__('<h3 class="section-title">No posts in the %s category yet</h3></div>'), single_cat_title('',false));
    		} else {
    			echo(__('<h3 class="section-title">No posts found</h3></div>'));
    		}
    
    	endif; ?>
    
    		</div>
    		<!-- END MAIN -->
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    Куда только не вставлял я данный код постоянно выдает ошибку и не грузит этот урл, за то другие норм работают.

    Может ли кто нибудь указать куда именно нужно вставить код, чтобы он работал?

Просмотр 2 ответов — с 1 по 2 (всего 2)
  • Куда только не вставлял я данный код

    Судя по всему его нужно вставить вместо строк:

    <?php
    if(is_category(74)) {include('wp-content/descript/1.txt');}//Assassins Creed
     */?>

    Автор Day-Trader

    (@day-trader)

    А это уже я сам вставлял, и с этим вариантом не работает.

Просмотр 2 ответов — с 1 по 2 (всего 2)

Тема «Вставка описания категории перед статьями» закрыта для новых ответов.