Created
June 26, 2014 19:29
-
-
Save mjsdiaz/a1333d73ae8177af1da3 to your computer and use it in GitHub Desktop.
Genesis Template for iThemes Exchange Category layout similar to the store
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Added Taxonomy page identical to store */ | |
.tax-it_exchange_category .it-exchange-products {margin: 0;padding: 0;} | |
.tax-it_exchange_category .it-exchange-products li {list-style: none;display: block;float:left;width: 45%;margin: 0 0 5em 0;vertical-align: top;} | |
.tax-it_exchange_category .it-exchange-products li:nth-child(2n+1) {margin-right: 5%;clear:both;} | |
.tax-it_exchange_category .it-exchange-product-details {padding: 1em;overflow:hidden;} | |
.tax-it_exchange_category .it-exchange-product-title {font-size: 1.5em;margin: .5em 0;padding: 0;} | |
.tax-it_exchange_category .it-exchange-product-title a {text-decoration: none;} | |
.tax-it_exchange_category .it-exchange-base-price {font-size: 1.25em;float:left;} | |
.tax-it_exchange_category .it-exchange-product-permalink {float:right;line-height: 2;} | |
.tax-it_exchange_category .featured-image-wrapper img {max-width: 100%; height: auto;} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* | |
* This is the archive page to show the product-categories for a layout similar to the store page. | |
* It is rough; use as a start. | |
* | |
*/ | |
remove_action( 'genesis_entry_content', 'genesis_do_post_content', 8 ); | |
add_action( 'genesis_before_entry_content', 'ladual_do_post_content', 8 ); | |
remove_action( 'genesis_entry_header', 'genesis_do_post_title'); | |
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); // works | |
remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); // works | |
global $post; | |
function ladual_do_post_content() { | |
if ( ! is_tax( 'it_exchange_category') ) | |
return; | |
it_exchange_set_product( $post->ID ); | |
?> | |
<?php /*----*/ | |
//Works | |
/*echo '<div>'; | |
it_exchange( 'product', 'featured-image', array( 'size' => 'thumbnail' ) ); | |
echo '</div>';*/ | |
?> | |
<?php if ( it_exchange( 'product', 'has-images' ) ) { ?> | |
<a class="it-exchange-product-feature-image" href="<?php it_exchange( 'product', 'permalink', array( 'format' => 'url' ) ); ?>"> | |
<?php it_exchange( 'product', 'featured-image', array( 'size' => 'large' ) ); ?> | |
</a> | |
<?php } ?> | |
<h2 class="it-exchange-product-title entry-title"> | |
<a href="<?php it_exchange( 'product', 'permalink', array( 'format' => 'url' ) ); ?>"> | |
<?php it_exchange( 'product', 'title', array( 'format' => 'text' ) ); ?> | |
</a> | |
</h2> | |
<div class="it-exchange-product-price"> | |
<?php it_exchange( 'product', 'base-price' ); ?> | |
</div> | |
<?php | |
/*echo '<div class="it-exchange-product-description">'; | |
it_exchange( 'product', 'description' ); | |
echo '</div>';*/ | |
?> | |
<a class="it-exchange-product-permalink" href="<?php it_exchange( 'product', 'permalink', array( 'format' => 'url' ) ); ?>"> | |
<?php _e( 'View Details', 'it-l10n-ithemes-exchange' ); ?> | |
</a> | |
<?php | |
//it_exchange( 'product', 'super-widget' ); //Doesn't do anything - remove | |
//it_exchange_get_template_part_elements( 'content_product', 'product_info_loop', array( 'base-price', 'super-widget', 'description' ) ); | |
//it_exchange_get_template_part( 'content', 'product' ); //This does the whole detail page | |
} | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment