Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function toolbox_widgets_init() {
- register_sidebar(array(
- 'name' => 'Banner Widget',
- 'id' => 'banner-widget',
- 'description' => 'Banner Widget',
- 'before_widget' => '<div id="homepage-banner">',
- 'after_widget' => '</div>',
- 'before_title' => '',
- 'after_title' => ''
- ));
- // Area 5, located in the footer. Empty by default.
- register_sidebar( array(
- 'name' => 'Home Widget',
- 'id' => 'home-widget',
- 'description' => 'Home Widget',
- 'before_widget' => '<div id="home-widget-box">',
- 'after_widget' => '</div>',
- 'before_title' => '',
- 'after_title' => ''
- ) );
- // Area 3, located in the footer. Empty by default.
- register_sidebar( array(
- 'name' => __( 'First Footer Widget Area', 'twentyten' ),
- 'id' => 'first-footer-widget-area',
- 'description' => __( 'The first footer widget area', 'twentyten' ),
- 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
- 'after_widget' => '</li>',
- 'before_title' => '<h3>',
- 'after_title' => '</h3>',
- ) );
- // Area 4, located in the footer. Empty by default.
- register_sidebar( array(
- 'name' => __( 'Second Footer Widget Area', 'twentyten' ),
- 'id' => 'second-footer-widget-area',
- 'description' => __( 'The second footer widget area', 'twentyten' ),
- 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
- 'after_widget' => '</li>',
- 'before_title' => '<h3>',
- 'after_title' => '</h3>',
- ) );
- // Area 5, located in the footer. Empty by default.
- register_sidebar( array(
- 'name' => __( 'Third Footer Widget Area', 'twentyten' ),
- 'id' => 'third-footer-widget-area',
- 'description' => __( 'The third footer widget area', 'twentyten' ),
- 'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
- 'after_widget' => '</li>',
- 'before_title' => '<h3>',
- 'after_title' => '</h3>',
- ) );
- }
- add_action( 'init', 'toolbox_widgets_init' );
- if ( function_exists( 'add_theme_support' ) ) {
- add_theme_support( 'post-thumbnails' );
- set_post_thumbnail_size( 863, 328 );
- }
- /**
- * Creates a shortcode to add a product to the cart
- *
- */
- function my_it_exchange_add_to_cart($atts) {
- extract(shortcode_atts(array(
- "product_id" => null
- ), $atts));
- it_exchange_set_product( $product_id );
- $output = "<div class='my_it_itemdescription'>Item: " . it_exchange( 'product', 'get-description' ) . "</div>";
- $output .= "<div class='my_it_price'>Price: " . it_exchange( 'product', 'get-base-price' ) . "</div>";
- $output .= "<div class='my_it_buy-now'>" .it_exchange( 'product', 'get-purchase-options', array( 'add-to-cart-edit-quantity' => true, 'buy-now-edit-quantity' =>true ) ) . "</div>";
- return $output;
- }
- add_shortcode( 'add-to-cart', 'my_it_exchange_add_to_cart' );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement