Forums

unique code at top of each shopping cart category (5 posts)

  1. kbchp
    Member
    Posted 4 months ago #

    I'm using WordPress as a shopping cart and I need to place unique content at the top of each category describing the category. Are there any existing plug-ins that fulfull this or can anyone help me with the code, please. I'm not a beginner but I'm not particularly code savvy.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

    If your theme displays the category description field, you can use that.

  3. kbchp
    Member
    Posted 4 months ago #

    Thanks esmi. It does but what I really need is a full unique post I can add info, category specific banners etc to for each category. The dev site is http://dev.official-merchandise.com - this should give you a clearer idea of what I'm trying to achieve.

    The loop-gallery code in place is:

    <?php
    	if (is_home()) {
    		$blog_cat = get_option('of_blog_category');
    		$category_id = get_cat_ID( $blog_cat );
    		$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    		query_posts("cat=-$category_id&paged=$paged");
    	}
    ?>
    
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <div id="post-<?php the_ID(); ?>" <?php post_class('gallery-item') ?>>
    	<a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><img src="<?php bloginfo('template_url'); ?>/timthumb.php?src=<?php $image_one="image_one"; echo get_post_meta($post->ID, $image_one, true); ?>&h=138&w=138" alt="Product Image 1" /></a>
    
    	<div><h2><a class="item-title" href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2></div>
    
        <div><a class="price" href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php echo get_option('of_currency_symbol'); ?><?php $product_price="product_price"; echo get_post_meta($post->ID, $product_price, true); ?></a></div>
    </div> <!-- gallery-item -->
    
    <?php endwhile; else : ?>

    ... so the code is already choosing the category, but I can't find a way to link a unique category post to each one

  4. esmi
    Theme Diva & Forum Moderator
    Posted 4 months ago #

  5. kbchp
    Member
    Posted 4 months ago #

    I've already added and tried Category Templates but they were overcomplicating things and breaking the shopping cart loop at the single-post stage. I've just added a plugin to allow html within category descriptions and echoed that before the loop - it's working!! and will do the trick for me, although a little bit clumsy to edit

Reply

You must log in to post.

About this Topic