Skip to content

Instantly share code, notes, and snippets.

View inspiredearth's full-sized avatar

Inspired Earth inspiredearth

View GitHub Profile
@mrkdevelopment
mrkdevelopment / In your social icons file
Last active July 29, 2022 00:25
Divi social icons extension
<?php if ( 'on' === et_get_option( 'divi_show_linkedin_icon', 'on' ) ) : ?>
<li class="et-social-icon et-social-linkedin">
<a href="<?php echo esc_url( et_get_option( 'divi_linkedin_url', '#' ) ); ?>" class="icon">
<span><?php esc_html_e( 'Linked In', 'Divi' ); ?></span>
</a>
</li>
<?php endif; ?>
<?php if ( 'on' === et_get_option( 'divi_show_youtube_icon', 'on' ) ) : ?>
<li class="et-social-icon et-social-youtube">
@lots0logs
lots0logs / child-functions-php-snippet.php
Last active April 19, 2020 08:16
WordPress :: Divi Theme :: Include Tags In Post Meta When Displayed On Frontend
<?php
/* DON'T copy the first line (above) if your functions.php already has it.
* ----------------------------------------------------------------------- */
function et_pb_postinfo_meta( $postinfo, $date_format, $comment_zero, $comment_one, $comment_more ){
$postinfo_meta = '';
if ( in_array( 'author', $postinfo ) )
$postinfo_meta .= ' ' . esc_html__( 'by', 'et_builder' ) . ' <span class="author vcard">' . et_pb_get_the_author_posts_link() . '</span>';
if ( in_array( 'date', $postinfo ) ) {
if ( in_array( 'author', $postinfo ) ) $postinfo_meta .= ' | ';
@ControlledChaos
ControlledChaos / README.md
Last active June 22, 2023 07:47
Change the default WordPress post name to News and replace the Dashicon.

Change Default Posts to News

WordPress Snippet

@julianxhokaxhiu
julianxhokaxhiu / pagespeed_optimize_images.sh
Last active April 15, 2024 22:49
Recursively optimize all PNG and JPG files wherever they are from the script position and inner ( based on OPTING, PNGCRUSH, ADVANCECOMP and JPEGOPTIM )
#!/bin/bash
# Improved as per feedback from @pascal - https://gist.github.com/julianxhokaxhiu/c0a8e813eabf9d6d9873#gistcomment-3086462
find . -type f -iname "*.png" -exec optipng -nb -nc {} \;
find . -type f -iname "*.png" -exec advpng -z4 {} \;
find . -type f -iname "*.png" -exec pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow {} \;
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" \) -exec jpegoptim -f --strip-all {} \;
@bjornjohansen
bjornjohansen / run-wp-cron.sh
Last active September 17, 2023 21:12
Run all due cron events for WordPress with WP-CLI. Works with both single sites and multisite networks.
#!/bin/bash
# Copyright © 2015 Bjørn Johansen
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
WP_PATH="/path/to/wp"
# Check if WP-CLI is available
if ! hash wp 2>/dev/null; then
@fevangelou
fevangelou / default.vcl_PREFACE.md
Last active April 9, 2024 04:30
The perfect Varnish configuration for WordPress, Joomla, Drupal & other (common) CMS based websites

The perfect Varnish configuration for WordPress, Joomla, Drupal & other (common) CMS based websites

Updated on December 15th, 2021

IMPORTANT: Read this before implementing one of the configuration files below (for either Varnish 3.x or 4.x+).

USE: Replace the contents of the main Varnish configuration file located in /etc/varnish/default.vcl (root server access required - obviously) with the contents of the configuration you'll use (depending on your Varnish version) from the 2 examples provided below.

IMPORTANT: The following setup assumes a 180 sec (3 minute) cache time for cacheable content that does not have the correct cache-control HTTP headers. You can safely increase this to 300 sec (or more) for less busier sites or drop it to 60 sec or even 30 sec for high traffic sites. It obviously depends on your use case.

@hofmannsven
hofmannsven / README.md
Last active October 6, 2023 21:05
Storing WordPress files and database with WP-CLI on the server.

WordPress Backups with WP-CLI

@nhbeachguy
nhbeachguy / remove divi down arrow.css
Last active October 10, 2020 04:36
Divi Theme: remove that little down arrow for Top Level Menu items that have a drop down sub-menu....
/* remove divi default effects for items with a drop down menu */
‪#‎top‬-menu .menu-item-has-children > a:first-child {padding-right: 0px; padding-bottom: 17px!important;}
#top-menu .menu-item-has-children > a:first-child:after{content: ''; margin-top: -2px;}
@Vestride
Vestride / encoding-video.md
Last active April 24, 2024 09:59
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@jcdarwin
jcdarwin / monit-and-gmail
Last active February 12, 2023 11:10
How to allow monit to use gmail as a smtp relay to send out alert emails
# visit https://accounts.google.com/DisplayUnlockCaptcha and click to allow access
# edit /etc/monit/monitrc to include the following
set mailserver smtp.gmail.com port 587
username "whoever@gmail.com" password "whatever"
using tlsv1
with timeout 30 seconds
# run the following to validate access