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 | |
/* | |
Plugin Name: woocommerce modal variationn | |
Plugin URI: # | |
Description: show modal window with product variations after clicking -add to cart-. | |
Version: 0.1 | |
Author: Maks Buriy | |
Author URI: mailto:byymster@gmail.com | |
License: GPL2 | |
*/ |
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 | |
add_action( 'init', 'my_theme_custom_post' ); | |
function my_theme_custom_post() { | |
register_post_type( 'agent', | |
array( | |
'labels' => array( | |
'name' => __( 'Agents' ), |
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 | |
global $post; | |
$terms = get_the_terms( $post->ID, 'product_cat' ); | |
foreach ($terms as $term) { | |
$product_cat_id[] = $term->term_id; | |
break; | |
} | |
print_r (array_filter( array_unique( $product_cat_id ))) ; |
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
https://stackoverflow.com/questions/21009516/get-woocommerce-product-categories-from-wordpress | |
https://stackoverflow.com/questions/38288298/cant-get-category-object-in-some-templates-of-woocommerce?noredirect=1&lq=1 | |
<?php | |
$get_featured_cats = array( | |
'taxonomy' => 'product_cat', | |
'orderby' => 'name', | |
'hide_empty' => '0', | |
'include' => $cat_array | |
); |
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
function woocommerce_cart_link() { | |
global $woocommerce; | |
?> | |
<a href="<?php echo esc_url($woocommerce->cart->get_cart_url()); ?>" title="<?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count);?> <?php _e('in your shopping cart', 'woothemes'); ?>" class="cart-button "> | |
<span class="label"><?php esc_html_e('My Basket:', 'woothemes'); ?></span> | |
<?php echo esc_html($woocommerce->cart->get_cart_total()); ?> | |
<span class="items"><?php echo sprintf(_n('%d item', '%d items', $woocommerce->cart->cart_contents_count, 'woothemes'), $woocommerce->cart->cart_contents_count); ?></span> | |
</a> | |
<?php | |
} |
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 | |
/* | |
Plugin Name: Ninja Table Dynamic Data | |
Description: Dynamic Data Example For Ninja Tables | |
Version: 1.0.0 | |
Author: WPManageNinja Shahjahan Jewel | |
Author URI: https://wpmanageninja.com/ | |
Plugin URI: https://wpmanageninja.com/downloads/ninja-tables-pro-add-on/ | |
License: GPLv2 or later | |
Text Domain: ninja_table_dynamic_data |
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 | |
function stock_styled_map_shortcode($atts, $content = null) { | |
extract( shortcode_atts( array( | |
'lat' => '40.7433379', | |
'lng' => '-74.0103219', | |
'title' => esc_html('Head Office', 'stock-toolkit'), | |
'desc' => esc_html('House 21, Grand St. New York, USA', 'stock-toolkit'), | |
'height' => '500', | |
), $atts) ); |
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
## table of contents: | |
===================== | |
1. Basic Php | |
2. Install WordPress in live server | |
2.1. WordPress Dashboard Introduction | |
3. Introduce about IDE & WordPress template hierarchy | |
4. Introducing about Visual Composer | |
4.1. Visual Composer academy site | |
4.2. Use Visual Composer Element/Addons |
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 //<~ dont add me in | |
add_filter( 'post_class', 'themeprefix_odd_even_classes' ); | |
function themeprefix_odd_even_classes( $classes ) { | |
global $wp_query; | |
if($wp_query->current_post % 2 == 0) {//http://stackoverflow.com/questions/7959247/php-test-if-number-is-odd-or-even | |
$classes[] = 'odd'; | |
} |
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 | |
// WP_Query Arguments | |
$args = array( | |
'order' => 'DESC', | |
'posts_per_page' => 5 | |
); | |
// The Loop | |
$query = new WP_Query( $args ); |
NewerOlder