Skip to content

Instantly share code, notes, and snippets.

Avatar

SiteBuilderOne sitebuilderone

View GitHub Profile
@sitebuilderone
sitebuilderone / wp_fun.php
Last active May 5, 2021
WP fun-functions
View wp_fun.php
<?php
// WP fun-functions
/*
* Custom favicon
*/
function my_favicon()
{ ?>
<link rel="shortcut icon" href="https://www.---.com/your-custom-image.jpg" >
<?php }
@sitebuilderone
sitebuilderone / anton.php
Last active May 5, 2021
General catch-all snippets
View anton.php
<?php
// General catch-all WP functions
Access token works
?>
@sitebuilderone
sitebuilderone / google-gtm-wp
Last active May 5, 2021
Add GTM to WP via Code Snippets/functions file
View google-gtm-wp
<?php
/**
* Adds Google Tag Manager (GTM) code in <head>
*/
add_action( 'wp_head', 'sb_google_tag_manager',100 );
function sb_google_tag_manager() { ?>
<!-- Google Tag Manager -->
<script>code here ...</script>
View sb1-shortcodes.php
<?php
// Shortcodes
// sitebuilderone.com
// https://codex.wordpress.org/Shortcode_API
// Shortcodes are supposed to return your html, not echo it.
// types: https://speckyboy.com/getting-started-with-wordpress-shortcodes-examples/
function sb1_current_mo_yr() {
View WP-setup.md
@sitebuilderone
sitebuilderone / django-commands
Last active Dec 13, 2018
Simple Django commands for reference
View django-commands
django_commands.md
#django version - on MAC using version 3
python3 -m django --version
#Create a project
django-admin.py startproject antonblog
# run project
python3 manage.py runserver
@sitebuilderone
sitebuilderone / Web Page Caching.md
Last active Dec 25, 2018
How to control web page caching
View Web Page Caching.md
@sitebuilderone
sitebuilderone / CPT-snippets.php
Last active Dec 3, 2018
Custom post types (CPT) snippets
View CPT-snippets.php
// display category terms for CPT3
$terms = get_the_terms( $post->ID , 'website_tools_category' );
foreach ( $terms as $term ) {
$term_link = get_term_link( $term, 'website_tools_category' );
if( is_wp_error( $term_link ) )
continue;
echo '<a href="' . $term_link . '">' . $term->name . '</a>';
}
@sitebuilderone
sitebuilderone / templates>six>css>custom.css
Created Nov 28, 2018
WHMCS Customization templates>six>css>custom.css
View templates>six>css>custom.css
/*
SiteBuilderOne WHMCS Customization
templates>six>css>custom.css
*/
@import "https://fonts.googleapis.com/css?family=Oxygen";