Skip to content

Instantly share code, notes, and snippets.

View phirebase's full-sized avatar
🏠
Working from home

David Klhufek phirebase

🏠
Working from home
View GitHub Profile
@phirebase
phirebase / wordpress-db-get-autoload-size.sql
Created December 20, 2023 16:16 — forked from yanknudtskov/wordpress-db-get-autoload-size.sql
This will show you the autoloaded data size, how many entries are in the table, and the first 10 entries by size. #optimization #database #mysql
SELECT 'autoloaded data in KiB' as name, ROUND(SUM(LENGTH(option_value))/ 1024) as value FROM wp_options WHERE autoload='yes'
UNION
SELECT 'autoloaded data count', count(*) FROM wp_options WHERE autoload='yes'
UNION
(SELECT option_name, length(option_value) FROM wp_options WHERE autoload='yes' ORDER BY length(option_value) DESC LIMIT 10)
.et_mobile_menu .parent-menu-item > a {
background-color: transparent;
position: relative;
}
.et_mobile_menu .parent-menu-item > a:after {
font-family: 'ETmodules';
content: '\3b';
font-weight: normal;
position: absolute;
<script>
(function($) {
function collapse_menu() {
var ParentMenuItem = $('.et_mobile_menu .parent-menu-item > a');
ParentMenuItem.off('click').click(function() {
$(this).attr('href', '#');
$(this).parent().children().children().toggleClass('show-menu-items');
$(this).toggleClass('switched-icon');
});
}
@phirebase
phirebase / .htaccess
Created June 30, 2022 12:38 — forked from seoagentur-hamburg/.htaccess
UPDATE 2022/05: Perfect .htaccess file for highspeed and security. You can use it for every WordPress-Website without problems. Highspeed and Security - testet on hundreds of Websites. If you are using a WordPress Multisite, change the last part of this file.
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2.0.4 - 05/2022
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://seoagentur-hamburg.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################
@phirebase
phirebase / per-kg.php
Created January 16, 2021 20:44 — forked from neilgee/per-kg.php
WooCommerce add a weight amount after the price such as 'per kg'
<?php //<~ don't add me in
add_filter( 'woocommerce_get_price_html', 'wb_change_product_html' );
// Change and return $price_html variable using the $price and weight amount
function wb_change_product_html( $price ) {
$price_html = '<span class="amount">' . $price . ' per kg </span>'; // change weight measurement here
return $price_html;
}
@phirebase
phirebase / divi-lightbox-snippet-for-functions.php
Created October 5, 2019 12:04 — forked from CoachBirgit/divi-lightbox-snippet-for-functions.php
DIVI: add lightbox to regular content images
/* add .et_pb_lightbox_image clss to content images */
add_filter('the_content', 'divi_add_lightbox');
function divi_add_lightbox($content) {
global $post;
$pattern ="/<a(.*?)href=('|\")(.*?).(bmp|gif|jpeg|jpg|png)('|\")(.*?)>/i";
$replacement = '<a$1href=$2$3.$4$5 class="et_pb_lightbox_image" title="'.$post->post_title.'"$6>';
$content = preg_replace($pattern, $replacement, $content);
return $content;
}
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery(".hyper_this").on('click', function(){
window.location = "https://divinotes.com/free-premium-divi-theme-layouts/";
});
});
</script>
@phirebase
phirebase / functions.php
Created March 21, 2018 13:43 — forked from jamesfosker/functions.php
Change the slugs of project post, project category and project tags, add this to your child theme functions.php, once you've changed the slug on line 5, 20 & 38, go to your dashboard and go setting/permalinks and just hit the save button to update the slugs
/*Change Project Post Type Slug*/
function ds_divi_modify_project_post_slug() {
return array(
'feeds' => true,
'slug' => 'new-slug', /*Change text between brackets*/
'with_front' => false,
);
}
add_filter( 'et_project_posttype_rewrite_args', 'ds_divi_modify_project_post_slug' );
@phirebase
phirebase / functions.php
Created November 22, 2017 13:14 — forked from indikatordesign/functions.php
[Combine "Divi - Filterable Blog Module" with the "Events Manager" plugin]
<?php
// Here you can see how to combine "Divi - Filterable Blog Module" with the free plugin "Events Manager": https://wordpress.org/plugins/events-manager/
// Just add these snippets to your themes functions.php and change them according to your needs.
// Combine Event Manager with "Divi – Filterable Blog Module" by changing the $query_args
add_filter( 'dfbm_query_args_output', function( $query_args )
{
if ( 'event' == $query_args['post_type'] )