Skip to content

Instantly share code, notes, and snippets.

View currentcreative's full-sized avatar

Current Creative currentcreative

View GitHub Profile
-- Change Siteurl & Homeurl
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com') WHERE option_name = 'home' OR option_name = 'siteurl'
-- Change GUID
UPDATE wp_posts SET guid = REPLACE (guid, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com')
-- Change URL in Content
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com')
-- Change Image Path Only
@currentcreative
currentcreative / digitalroot.js
Created November 12, 2016 06:24 — forked from johnstew/digitalroot.js
JS Digital Root
function root(num){
var total = 0;
if(num.toString().length == 1){
var iNum = parseInt(num);
return iNum;
}else{
num.toString().split("").forEach( function(value){
var iValue = parseInt(value);
return total += iValue;
});
@currentcreative
currentcreative / sample-plugin.php
Created January 5, 2017 21:01 — forked from brianhogg/sample-plugin.php
Example of is_new
<?php
/*
Plugin Name: Sample Plugin
Plugin URI: https://brianhogg.com/
Description: Showing is_new
Version: 1.0
Author: Brian Hogg
Author URI: https://brianhogg.com
License: GPLv2 or later
*/
@currentcreative
currentcreative / style.css
Created May 4, 2019 02:13 — forked from NatalieMac/style.css
Sticky footer w/ Underscores markup
html {
height: 100%;
overflow: hidden;
}
body {
height: 100%;
overflow: scroll;
}
/* Min value, flexible value in between, Max value */
padding: clamp(5px, 1vw, 25px);
font-size: clamp(10px, calc(1vw + 10px), 40px);
/* from : https://twitter.com/wesbos/status/1266490952165842955 */
@currentcreative
currentcreative / git_and_github_instructions.md
Last active January 14, 2022 05:16 — forked from mindplace/git_and_github_instructions.md
Pushing your first project to github

Make sure git is tracking your project.

  1. Using your terminal/command line, get inside the folder where your project files are kept: cd /path/to/my/codebase.

You cannot do this simply by opening the folder normally, you must do this with the command line/terminal.

Do you need a refresher on using your command line/terminal? I've compiled my favorite resources here.

  1. Check if git is already initialized: git status
@currentcreative
currentcreative / wp-remove-admin-spacing.txt
Last active May 19, 2023 16:31
Remove weird spacing above Admin bar when testing mobile view in browser
/* ADD THIS TO functions.php */
// REMOVE MARGIN FROM WP ADMIN BAR during mobile testing
add_theme_support( 'admin-bar', array( 'callback' => 'my_admin_bar_css') );
function my_admin_bar_css()
{
?>
<style type="text/css">
@media screen and (max-width: 600px) {
html body { margin-top: 0 !important; }
@currentcreative
currentcreative / Boostrap5-offcanvas-anchor-links-fix.js
Last active April 18, 2024 18:03
Bootsrap 5.3 offcanvas JS fix for anchor links in menu