Simple explanation of how to add a map to a website using Google Maps API v3
Forked from Enrique Moreno Tent's Pen Google Maps API v3 - Basic Map.
A Pen by Kharis Sulistiyono on CodePen.
| /*------------------------------------------------------------*/ | |
| /* Register Custom Portfolio Taxonomy */ | |
| /*------------------------------------------------------------*/ | |
| if ( ! function_exists( 'my_custom_portfolio_taxonomy' ) ) : | |
| function my_custom_portfolio_taxonomy() { | |
| $labels = array( | |
| 'name' => _x( 'Portfolio Categories', 'Taxonomy General Name', 'owlabpfl' ), |
| <?php | |
| /** | |
| * Change add to cart text in single product page | |
| */ | |
| add_filter('woocommerce_product_add_to_cart_text', 'modify_add_to_cart_text', 10, 2); | |
| function modify_add_to_cart_text($product){ | |
| global $product; |
| <?php | |
| add_action( 'woocommerce_product_query', 'my_custom_query_by_author', 10, 2 ); | |
| function my_custom_query_by_author($q, $product){ | |
| $author = $_GET['creator']; // Author ID param | |
| if( isset($author) && $author != '' ){ | |
| $q->set('author', $author); | |
| } |
| <?php | |
| add_filter('woocommerce_get_availability', 'my_availability_message', 10, 2); | |
| function my_availability_message($args, $product){ | |
| $args = array( | |
| 'availability' => __('Always Available', 'textdomain'), | |
| 'class' => 'always-available' | |
| ); |
| <?php | |
| /** | |
| * Extending query parameter of product shortcode | |
| */ | |
| add_filter('woocommerce_shortcode_products_query', 'my_wc_shortcode_product_query_args', 10, 2); | |
| function my_wc_shortcode_product_query_args($args, $atts){ | |
| if ( isset( $atts['item'] ) ) { |
Simple explanation of how to add a map to a website using Google Maps API v3
Forked from Enrique Moreno Tent's Pen Google Maps API v3 - Basic Map.
A Pen by Kharis Sulistiyono on CodePen.
| /** | |
| * Zerif Lite version 1.8.2.9 | |
| */ | |
| add_filter('get_the_excerpt', 'zerif_add_read_more_link'); | |
| function zerif_add_read_more_link($post_excerpt){ | |
| global $post; | |
| if(strstr($post->post_content,'<!--more-->')) { | |
| $more_link = ' <a class="more-link" href="'.esc_attr(get_permalink($post->ID) . "#more-{$post->ID}").'">'.__('Continue reading', 'zerif-lite').'</a>'; |
| <?php | |
| /** | |
| * All products in one page | |
| * | |
| * Display all products in a table with their add to cart button. | |
| * Usage : [all_products] to display all products. | |
| * Usage : [all_products category="singles"] to display products under "singles" category (slug). | |
| */ |
| <?php if ( get_theme_mod('site_logo') ) : ?> | |
| <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php bloginfo('name'); ?>"><img class="site-logo" src="<?php echo esc_url(get_theme_mod('site_logo')); ?>" alt="<?php bloginfo('name'); ?>" /></a> | |
| <?php else : ?> |
| <?php if ( get_theme_mod('site_logo') ) : ?> | |
| <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php bloginfo('name'); ?>"><img class="site-logo" src="<?php echo esc_url(get_theme_mod('site_logo')); ?>" alt="<?php bloginfo('name'); ?>" /></a> | |
| <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2> | |
| <?php else : ?> |