Ответы в темах

Просмотр 3 ответов — с 1 по 3 (всего 3)
  • Вот скрин:

    http://s005.radikal.ru/i212/1406/15/03f69f103ecf.jpg

    Код страницы «Шаблон страницы «Shop» (products.php)»:

    <?php
    /**
       Template name: Shop
    
     * 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.
     * E.g., it puts together the home page when no home.php file exists.
     * Learn more: http://codex.wordpress.org/Template_Hierarchy
     *
     * @package web2feel
     * @since web2feel 1.0
     */
    
    get_header(); ?>
    
    		<div id="primary" class="content-area cf">
    			<div id="content" class="site-content" role="main">
    <div class="article-list cf">
    		<?php
    		if ( get_query_var('paged') )
    		    $paged = get_query_var('paged');
    		elseif ( get_query_var('page') )
    		    $paged = get_query_var('page');
    		else
    		    $paged = 1;
    		$wp_query = new WP_Query(array('post_type' => 'products', 'posts_per_page' => '25', 'paged' => $paged ));
    		?>
    		<?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
    
    			<div class="product-box grid_3">
    				<div class="prod-thumb">
    					<?php
    						$thumb = get_post_thumbnail_id();
    						$img_url = wp_get_attachment_url( $thumb,'full' ); //get full URL to image (use "large" or "medium" if the images too big)
    						$image = aq_resize( $img_url, 180, 150, false ); //resize & crop the image
    					?>
    					<?php if($image) : ?> <a href="<?php the_permalink(); ?>"><img src="<?php echo $image ?>"/></a> <?php endif; ?>
    				</div>
    
    				<div class="prod-info">
    					<div class="pricebar cf">
    						<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    						<span class="pricetag"><?php echo get_post_meta($post->ID,'_product_info_product_price', true); ?> </span>
    					</div>
    
    					<p> <?php echo get_post_meta($post->ID,'_product_info_product_description', true); ?> </p>
    
    					<div class="prod-footer cf">
    						<span class="pleft"> <a href="<?php the_permalink(); ?>">Подробнее</a> </span>
    						<span class="pright"><a href="<?php echo get_post_meta($post->ID,'_product_info_product_link', true); ?>">Купить</a> </span>
    					</div>
    				</div>
    
    			</div>
    
    				<?php endwhile; ?>
    </div>
    				<?php //web2feel_content_nav( 'nav-below' ); ?>
    				<div class="grid_12">
    				<?php kriesi_pagination("$wp_query->max_num_pages"); ?>
    
    				</div>
    
    			</div><!-- #content .site-content -->
    		</div><!-- #primary .content-area -->
    
    <?php get_footer(); ?>

    Или может в этом файле править надо? Код страницы «product-search.php»:

    <?php
    /**
     * The template for displaying Search Results pages.
     *
     * @package web2feel
     * @since web2feel 1.0
     */
    
    get_header(); ?>
    
    		<section id="primary" class="content-area ">
    			<div id="content" class="site-content" role="main">
    
    			<?php if ( have_posts() ) : ?>
    
    				<header class="page-header grid_12">
    					<h1 class="page-title"><?php printf( __( 'Результаты поиска: %s', 'web2feel' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
    				</header><!-- .page-header -->
    
    				<?php //web2feel_content_nav( 'nav-above' ); ?>
    				<div class="article-list cf">
    				<?php /* Start the Loop */ ?>
    				<?php while ( have_posts() ) : the_post(); ?>
    
    					<div class="product-box grid_3">
    				<div class="prod-thumb">
    					<?php
    						$thumb = get_post_thumbnail_id();
    						$img_url = wp_get_attachment_url( $thumb,'full' ); //get full URL to image (use "large" or "medium" if the images too big)
    						$image = aq_resize( $img_url, 180, 150, false ); //resize & crop the image
    					?>
    					<?php if($image) : ?> <a href="<?php the_permalink(); ?>"><img src="<?php echo $image ?>"/></a> <?php endif; ?>
    				</div>
    
    				<div class="prod-info">
    					<div class="pricebar cf">
    						<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    						<span class="pricetag"><?php echo get_post_meta($post->ID,'_product_info_product_price', true); ?> </span>
    					</div>
    
    					<p> <?php echo get_post_meta($post->ID,'_product_info_product_description', true); ?> </p>
    
    					<div class="prod-footer cf">
    						<span class="pleft"> <a href="<?php the_permalink(); ?>">Подробнее</a> </span>
    						<span class="pright"><a href="<?php echo get_post_meta($post->ID,'_product_info_product_link', true); ?>">Купить</a> </span>
    					</div>
    				</div>
    
    			</div>
    
    				<?php endwhile; ?>
    				</div>
    				<?php kriesi_pagination(); ?>
    
    			<?php else : ?>
    
    				<?php get_template_part( 'no-results', 'search' ); ?>
    
    			<?php endif; ?>
    
    			</div><!-- #content .site-content -->
    		</section><!-- #primary .content-area -->
    
    <?php get_footer(); ?>

    Или проблема вообще не в коде? Заранее большое спасибо за любую помощь!

    Спасибо. На будущее буду знать, но сейчас уже отступать некуда, много работы проделано, очень нужна помощь в решении конкретно этой проблемы.

    Чего тут править нужно чтобы цена отобразилась?

    <div class="prod-info">
    					<div class="pricebar cf">
    						<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    						<span class="pricetag"><?php echo get_post_meta($post->ID,'_product_info_product_price', true); ?> </span>
    					</div>
    
    					<p> <?php echo get_post_meta($post->ID,'_product_info_product_description', true); ?> </p>

    Описание товара тоже не работает, но это не смертельно, главное разобраться с этой проблемой по Цене

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