This file contains hidden or 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
| // Display 6 products per page. Goes in functions.php | |
| add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 6;' ), 20 ); |
This file contains hidden or 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
| //Template Name: My template | |
| <ul class="products"> | |
| <?php | |
| $args = array( | |
| 'post_type' => 'product', | |
| 'posts_per_page' => 12 | |
| ); | |
| $loop = new WP_Query( $args ); | |
| if ( $loop->have_posts() ) { |
This file contains hidden or 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
| if ( ! function_exists( 'storefront_cart_link' ) ) { | |
| function storefront_cart_link() { | |
| ?> | |
| <a class="cart-contents" href="<?php echo esc_url( WC()->cart->get_cart_url() ); ?>" title="<?php _e( 'View your shopping cart', 'storefront' ); ?>"> | |
| <span class="amount"><?php echo wp_kses_data( WC()->cart->get_cart_subtotal() ); ?></span> <span class="count"><?php echo wp_kses_data( sprintf( _n( '%d item', '%d items', WC()->cart->get_cart_contents_count(), 'storefront' ), WC()->cart->get_cart_contents_count() ) );?></span> | |
| </a> | |
| <?php | |
| } | |
| } |
This file contains hidden or 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
| //send data from id=hidden_form to mail.php | |
| $("#hidden_form").submit(function() { | |
| $.ajax({ | |
| type: "POST", | |
| url: "mail.php", | |
| data: $(this).serialize() | |
| }).done(function() { | |
| $(this).find("input").val(""); | |
| //alert("Thank you!"); | |
| $("#hidden_form").trigger("reset"); |
This file contains hidden or 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
| HTML: | |
| <div class="wrapper"> | |
| <div class="tabs"> | |
| <span class="tab">Вкладка 1</span> | |
| <span class="tab">Вкладка 2</span> | |
| <span class="tab">Вкладка 3</span> | |
| </div> | |
| <div class="tab_content"> | |
| <div class="tab_item">Содержимое 1</div> | |
| <div class="tab_item">Содержимое 2</div> |
This file contains hidden or 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 | |
| $tags = get_tags(); | |
| if ($tags) { | |
| foreach ($tags as $tag) { | |
| echo '<p>Tag: <a href="' . get_tag_link( $tag->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $tag->name ) . '" ' . '>' . $tag->name.'</a> </p> '; | |
| } | |
| } | |
| ?> | |
| <?php | |
| $tags = wp_get_post_tags($post->ID); |
This file contains hidden or 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 if ( have_posts() ) : query_posts('p=1'); | |
| while (have_posts()) : the_post(); ?> | |
| <?php the_title(); ?> | |
| <?php the_content(); ?> | |
| <?php the_post_thumbnail(array(100, 100)); ?> | |
| <? endwhile; endif; wp_reset_query(); ?> |