Malin / custom-login-qrh.php
0 likes
0 forks
1 files
Last active
| 1 | // custom login styles and logo for QRh |
| 2 | |
| 3 | function custom_login_styles() { |
| 4 | $logo_url = 'https://qrh.app/wp-content/uploads/2021/09/QR-h-rojoAsset-7-300x243.png'; |
| 5 | ?> |
| 6 | <style type="text/css"> |
| 7 | /* Change login logo */ |
| 8 | body.login div#login h1 a { |
| 9 | background-image: url(<?php echo $logo_url; ?>); |
| 10 | padding-bottom: 30px; |
Malin / redirect-logout-to-home.php
0 likes
0 forks
1 files
Last active
| 1 | // redirect Wordpress logout to home |
| 2 | |
| 3 | add_action('wp_logout','auto_redirect_after_logout'); |
| 4 | function auto_redirect_after_logout(){ |
| 5 | wp_redirect(home_url()); |
| 6 | exit(); |
| 7 | } |
Malin / move-out-of-stock.php
0 likes
0 forks
1 files
Last active
| 1 | // move out of stock products to end of loop in WooCommerce Archives |
| 2 | |
| 3 | add_action( 'woocommerce_product_query', 'custom_woocommerce_product_query' ); |
| 4 | function custom_woocommerce_product_query( $q ) { |
| 5 | // Get any existing meta query from the query |
| 6 | $meta_query = $q->get('meta_query'); |
| 7 | |
| 8 | // Add our condition |
| 9 | $stock_status_meta_query = array( |
| 10 | 'relation' => 'OR', |
Malin / link-logo-to-homepage.php
0 likes
0 forks
1 files
Last active
| 1 | // link Wordpress login form logo to homepage and also logo hover text |
| 2 | |
| 3 | // Change the login page logo link to your homepage |
| 4 | function my_custom_login_url() { |
| 5 | return home_url(); |
| 6 | } |
| 7 | add_filter('login_headerurl', 'my_custom_login_url'); |
| 8 | |
| 9 | // Change the login page logo hover text |
| 10 | function my_custom_login_title() { |
Malin / custom-rewrite-qrh.php
0 likes
0 forks
1 files
Last active
| 1 | // force URL rewrite for QRh |
| 2 | function custom_rewrite_rule() { |
| 3 | // Adding a rewrite rule that maps the new URL to the internal query for product-category/outlet. |
| 4 | add_rewrite_rule('^tienda/outlet/?$', 'index.php?product_cat=outlet', 'top'); |
| 5 | } |
| 6 | add_action('init', 'custom_rewrite_rule'); |
| 7 | |
| 8 | function custom_rewrite_tag() { |
| 9 | // Adding the custom query var to ensure WordPress recognizes it. |
| 10 | add_rewrite_tag('%product_cat%', '([^&]+)'); |
Malin / deactivate-google-feed.php
0 likes
0 forks
1 files
Last active
| 1 | // custom QRh Feed check - not working correctly |
| 2 | add_action('woocommerce_product_options_inventory_product_data', 'add_google_feed_checkbox'); |
| 3 | |
| 4 | function add_google_feed_checkbox() { |
| 5 | global $post; |
| 6 | |
| 7 | // Get the current value of the '_google_feed_include' meta key. |
| 8 | $google_feed_include = get_post_meta($post->ID, '_google_feed_include', true); |
| 9 | |
| 10 | // Convert the meta value to a boolean. |
Malin / jpeg-optim.sh
0 likes
0 forks
1 files
Last active
| 1 | # optimize JPEG |
| 2 | |
| 3 | find ./*/files/wp-content -iname "*.jp*" -print0 | xargs -0 jpegoptim --strip-all -m90 |
Malin / memory-usage.sh
0 likes
0 forks
1 files
Last active
| 1 | # Determine memory usage of Apache |
| 2 | |
| 3 | ps -ylC apache2 | awk '{x += $8;y += 1} END {print "Apache Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}' |
Newer
Older