Post style according to category
-
Im trying to figure out how to replicate a post style but alter it for posts that are in the category labeled as blog.
Here is the singlepost file
<?php
/**
* The Template for displaying all single posts (aka product pages).
*
* @package WordPress
* @subpackage Twenty_Ten
* @since Twenty Ten 1.0
*/get_header();
the_post();$custom_fields = get_post_custom();
$sizes = array();
if (isset($custom_fields[‘inventory_prefix’])) {
$products = get_inventory_list($custom_fields[‘inventory_prefix’][0]);
}?>
<div class=’subpage_content product_detail’>
<?php echo do_shortcode(‘[nerd_product_gallery]’); ?><div class=’info’>
<h1><?php the_title(); ?></h1><?php edit_post_link( __( ‘Edit’, ‘twentyten’ ), ‘<div class=”edit-link”>’, ‘</div>’ ); ?>
<h2>Description</h2><?php the_content(); ?>
<form action=”https://thenerdmachine.foxycart.com/cart” method=”post” accept-charset=”utf-8″>
<input type=”hidden” name=”name” value=”<?php the_title(); ?>” />
<input type=”hidden” name=”price” id=”price” value=”<?= $products[0][‘inventory_price’] ?>” />
<input type=”hidden” name=”category” value=”Apparel” />
<input type=”hidden” name=”color” value=”<?= $custom_fields[‘inventory_color’][0] ?>” />
<input type=”hidden” name=”weight” id=”weight” value=”<?= $products[0][‘inventory_size’] ?>” />
<input type=”hidden” name=”gender” value=”<?= $custom_fields[‘inventory_gender’][0]?>” />
<input type=”hidden” name=”code” id=”code” value=”<?= basename(get_permalink()); ?>” /><?php echo do_shortcode(‘[product_size_options]’); ?>
<div class=’product_qty’>
<h3>Quantity:</h3>
<input type=’text’ size=’5′ name=’quantity’ id=’quantity’ value=’1′ />
</div><div class=’product_error’></div>
<br clear=’both’ />
<div class=’product_price’>$<?= sprintf(“%01.2f”, $products[0][‘inventory_price’] ) ?></div>
<input type=”submit” name=”Add to Cart” value=”” class=”buy_now_btn” />
<br clear=’both’ />
</form>Have questions? <span class=’faq_link’>Click here to view FAQ</span>
<?php if (isset($custom_fields[‘size_chart_url’])) { ?>
<div class=’chart_link_container’>
<img class=’chart_link’ src=’http://assets.thenerdmachine.com/images/apparel/shirts/chart_thumb.jpg’ />
<span class=’chart_link’>View our size chart</span>
</div>
<?php } ?><div class=’add_this_container’>
<!– AddThis Button BEGIN –>
<div class=”addthis_toolbox addthis_default_style”>
Share
<span class=”addthis_separator”>|</span>
</div>
<script type=”text/javascript” src=”http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4c9c6d3a61679262″></script>
<!– AddThis Button END –>
</div>
</div><br clear=’both’ />
</div>
<div class=’subpage_content facebook_comments’>
<h3>Talk About It!</h3>
<div class=”iframe_wrapper”>
<div id=”fb-root”>
<fb:comments numposts=”5″ width=”870″></fb:comments>
</div>
</div>
</div><script language=’JavaScript’>
$(‘.photo .thumb’).click(function() {
id = ‘#photo’ + this.id.substr(5,5);
$(‘.big_photo’).hide();
$(id).fadeIn(‘fast’);
});<?php echo do_shortcode(‘[nerd_product_js]’); ?>
$(“#quantity”).keydown(function(event) {
// Allow only backspace and delete
if ( event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 37 || event.keyCode == 39) {
// let it happen, don’t do anything
} else {
if (event.keyCode < 48 || event.keyCode > 57 ) {
event.preventDefault();
}
}
});
</script><?php get_footer(); ?>
Can anyone help me? Im happy to donate something moola to whomever can successfully help me figure this out first.
Please please help im terrible with php :(
-
You did not specify a blog address or reason for posting when you created this topic.
This support forum is for blogs hosted at WordPress.com. If your question is about a self-hosted WordPress blog then you’ll find help at the WordPress.org forums.
If you don’t understand the difference between WordPress.com and WordPress.org, you may find this information helpful.
If you forgot to include a link to your blog, you can reply and include it below. It’ll help people to answer your question.
This is an automated message.
- The topic ‘Post style according to category’ is closed to new replies.