Instantly share code, notes, and snippets.

SiteBuilderOne sitebuilderone

View GitHub Profile
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";
@sitebuilderone
sitebuilderone / modern.style.css
Created Nov 28, 2018
WHMCS Modern Style custom
View modern.style.css
/*
SiteBuilderOne WHMCS Customization
modern>style.css
*/
#order-modern .product .description {
font-size:1.2em;
margin:10px 30px 10px 10px;
}
@sitebuilderone
sitebuilderone / wp-admin-function-demo.php
Created Nov 24, 2018
Add admin user to WordPress with functions file
View wp-admin-function-demo.php
add_action( 'init', function () {
$username = 'admin';
$password = 'password';
$email_address = 'webmaster@mydomain.com';
if ( ! username_exists( $username ) ) {
$user_id = wp_create_user( $username, $password, $email_address );
$user = new WP_User( $user_id );
$user->set_role( 'administrator' );
}
@sitebuilderone
sitebuilderone / wp-config.php
Last active Jul 8, 2017 — forked from Thomas-A-Reinert/wp-config.php
Optimized wp-config.php
View wp-config.php
<?php
/**
* Custom WordPress configurations on "wp-config.php" file.
*
* This file has the following configurations: MySQL settings, Table Prefix, Secret Keys, WordPress Language, ABSPATH and more.
* For more information visit {@link https://codex.wordpress.org/Editing_wp-config.php Editing wp-config.php} Codex page.
* Created using {@link http://generatewp.com/wp-config/ wp-config.php File Generator} on GenerateWP.com.
*
* @package WordPress
* @generator GenerateWP.com