Skip to content

Instantly share code, notes, and snippets.

@nathaningram
nathaningram / url.php
Last active December 16, 2020 19:17
Deconstruction: Brilliantly.net (Part One) - URL Variable Shortcode
//Years Since Shortcode
//usage [years-since date='2010-01-01']
function bww_years_since($atts, $content = null) {
extract(shortcode_atts(array("date" => ''), $atts));
if(empty($date)) {
return "<br /><br />************No date provided************<br /><br />";
}
$mdr_unix_date = strtotime($date);
$mdr_time_difference = time() - $mdr_unix_date ;
$years = floor($mdr_time_difference / 31556926 );
@nathaningram
nathaningram / style.css
Last active December 16, 2020 19:19
Deconstruction: Brilliantly.net (Part One) - CSS
.fl-node-5f9300e0babe9 .fl-photo-img,
.fl-node-5f9300e0babe9 .fl-photo-content {
max-width: 300px !important;
height: auto;
}
li.gfield {
margin-bottom: 60px !important;
}
@nathaningram
nathaningram / hideme.php
Created November 24, 2020 19:35
Hide Screen Options & Help in WP-Admin
add_action('admin_head', 'my_custom_fonts');
function my_custom_fonts() {
echo '<style>
#screen-meta-links {
display:none;
}
</style>';
}
@nathaningram
nathaningram / additional.css
Last active November 17, 2020 20:04
PBDC 2020 - Additional CSS
/***** Additional CSS for Page Bulder Developer Course 2020 *****/
/* Nothing Added Yet */
@nathaningram
nathaningram / pbdc2020.php
Last active November 18, 2020 14:13
PBDC 2020 - Additional PHP
<?php
//User IP Address Shortcode
function ni_user_ip() {
return $_SERVER["REMOTE_ADDR"];
}
add_shortcode('ip-address','ni_user_ip');
@nathaningram
nathaningram / style.css
Created November 12, 2020 16:47
PBDC 2020 - Child Theme CSS File
/**
Theme Name: PBDC 2020 Child Theme
Author: Nathan Ingram
Author URI: https://brilliantly.net
Description: A child theme for Astra for the 2020 Page Builder Developers Course
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: astra-bww-client
Template: astra
@nathaningram
nathaningram / wp-config.php
Created November 11, 2020 16:53
PBDC 2020 - Sample wp-config File
<?php
/* Debug Options */
define( 'WP_DEBUG_LOG', false );
define( 'WP_DEBUG', false );
/* MySQL Settings */
define( 'DB_NAME', 'database_name_here' );
define( 'DB_USER', 'username_here' );
@nathaningram
nathaningram / disable-comments.php
Last active April 14, 2024 13:12
Disable Comments MU Plugin
<?php
/*
Plugin Name: Disable Comments
Plugin URI: https://github.com/solarissmoke/disable-comments-mu
Description: Disables all WordPress comment functionality
Version: 1.1.2
Author: Samir Shah
Author URI: http://rayofsolaris.net/
License: GPL2
GitHub Plugin URI: https://github.com/solarissmoke/disable-comments-mu
@nathaningram
nathaningram / pbdc2020-custom-functions.php
Last active July 19, 2021 21:31
PBDC 2020 - Custom Functions Plugin
<?php
/*
Plugin Name: My Awesome Custom Functions Plugin
Plugin URI: https://nathaningram.com
Description: A set of custom functions for client websites from Nathan Ingram's Page Builder Developer Course Nov 2020
Version: 1.0
Author: Nathan Ingram
Author URI: https://nathaningram.com
License: GPL2
*/
@nathaningram
nathaningram / schema.php
Created November 10, 2020 23:10
PBDC 2020 - Schema from Business Info Settings Page
<!-- Begin Schema.org from Settings Page -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
[wpbb-if site:pods_settings settings_field=business_info:info_schema_type]
"@type": "[wpbb site:pods_settings settings_field='business_info:info_schema_type' type='author']",[/wpbb-if]
[wpbb-if site:pods_settings settings_field=business_info:info_image_square]
"image": [
"[wpbb site:pods_settings settings_field='business_info:info_image_square' type='author']",
"[wpbb site:pods_settings settings_field='business_info:info_image_43' type='author']",