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 Product category and number of flavour attribute after shop loop title | |
add_filter( 'woocommerce_after_shop_loop_item_title', 'so58344618_variation_count' ); | |
function so58344618_variation_count() { | |
global $product; | |
$categories = get_the_terms( $post->ID, 'product_cat' ); | |
$catList = ''; | |
foreach($categories as $category) { | |
if(!empty($catList)) { |
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
<!--<select name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;"> | |
<option value=""><?php //esc_attr( _e( 'Select Month', 'textdomain' ) ); ?></option> --> | |
<?php wp_get_archives( array( | |
'post_type' => 'afr-news', | |
'type' => 'yearly', // monthly | |
'format' => 'custom', // option | |
'before' => '<div class="sub-item">', | |
'after' => '</div>', | |
'show_post_count' => 0 // 1 | |
) ); |
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 | |
<script src="https://maps.googleapis.com/maps/api/js?key=<?php the_field('gmap_api_key', 'option'); ?>"></script> | |
<style> | |
.acf-map { height: 600px; } | |
p.emails a:not(:last-child)::after { | |
content: ', '; | |
} | |
</style> | |
<div class="acf-map"> | |
<?php while ( have_rows('locations') ) : the_row(); |
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 | |
<div id="map"></div> | |
<script src="https://maps.googleapis.com/maps/api/js?key=<?php the_field('gmap_api_key', 'option'); ?>"></script> | |
<style type="text/css"> | |
#map { | |
width: 100%; | |
height: 600px; | |
} | |
</style> |
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('woocommerce_before_shop_loop', 'show_category_title', 10, 2); | |
function show_category_title() { | |
$cat_title = single_tag_title("", false); | |
$cat_description = tag_description("", false); | |
echo '<div class="all_notice">'<h2>' . $cat_title .'</h2><p>' . $cat_description . '</p></div>'; | |
} | |
?> |
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 footerCondition() { | |
// Not in edit mode | |
if ( ! \Elementor\Plugin::$instance->preview->is_preview_mode() ) { | |
?> | |
<script> | |
jQuery(function($){ | |
var footerHeight = $('.elementor.elementor-location-footer').height(); | |
$('.site-main section.elementor-top-section:last-child').css('padding-bottom', footerHeight); | |
$('.elementor.elementor-location-footer').css('margin-top', -footerHeight); |
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 | |
// Filter wp_nav_menu() to add additional links and other output | |
function new_nav_menu_items($items) { | |
if(!is_page(28)) { | |
$homelink = '<li class="home menu-item menu-item-type-custom menu-item-object-custom menu-item-009"><a href="' . get_permalink( 28 ) . '#bwe-showreel" class="elementor-item elementor-item-anchor">Showreel</a></li>'; | |
} | |
else { | |
$homelink = '<li class="home menu-item menu-item-type-custom menu-item-object-custom menu-item-009"><a href="#bwe-showreel" class="elementor-item elementor-item-anchor">Showreel</a></li>'; | |
} | |
// add the home link to the end of the menu |
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 footerCondition() { | |
// Not in edit mode | |
if ( ! is_user_logged_in() ) { | |
?> | |
<div id='load' class="loader"> | |
<div class='loader-content'> | |
<h2>Welcome to </h2> | |
<svg id="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="130.6122448979592" viewBox="0, 0, 400,130.6122448979592"><g id="svgg"><path id="path0" d="M27.974 3.612 C 24.011 11.963,13.678 21.020,5.226 23.553 L 0.943 24.836 1.237 33.081 L 1.531 41.327 6.904 41.282 C 13.710 41.226,16.052 39.067,17.891 31.156 C 20.765 18.793,31.470 11.335,38.325 16.920 C 40.277 18.510,40.276 18.522,38.265 17.729 C 28.022 13.687,23.508 19.238,23.481 35.911 L 23.469 42.740 27.806 43.130 L 32.143 43.521 27.806 43.699 L 23.469 43.878 23.469 50.510 C 23.469 57.800,23.540 57.862,29.182 55.504 C 37.779 51.912,49.462 56.289,53.489 64.610 L 56.048 69.898 56.085 34.949 L 56.122 0.000 42.905 -0.000 L 29.688 -0.000 27.974 3.612 M104.709 27.641 C 100.800 30.716,99.176 34.493,98.800 41.385 L 98.469 4 |
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 | |
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; | |
$default_posts_per_page = get_option( 'posts_per_page' ); | |
$args = array ( | |
'post_type' => 'post', | |
'posts_per_page' => -1, | |
'posts_per_page' => $default_posts_per_page, | |
'paged' => $paged, | |
'tax_query' => array( array( | |
'taxonomy' => 'category', |
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
//Providing the Gold pack download link on view order page under my account page. | |
add_action( 'woocommerce_view_order', 'before_woocommerce_order_details', 5 ); | |
function before_woocommerce_order_details($order_id){ | |
$order = wc_get_order( $order_id ); | |
$items = $order->get_items(); | |
foreach ( $items as $item_id => $item ) { | |
$product_id = $item->get_variation_id() ? $item->get_variation_id() : $item->get_product_id(); | |
if ( $product_id === 8936 ) { | |
if( $order->get_status() == 'processing' || $order->get_status() == 'completed' ) { | |
echo '<h3 style="background: #70C0AD;font-size: 20px;padding: 20px;margin-bottom: 30px; color: #fff;">In this order, you have purchased <a href="h#" target="_bkank" style="Color: #000; font-weight: bold;">Kidney Solution Gold Pack</a>. Please download the package from <a href="#" target="_bkank" style="Color: #000; font-weight: bold;">HERE</a>.</h3>'; |