Skip to content

Instantly share code, notes, and snippets.

@nielsenrc
nielsenrc / html-tel-tag.html
Created September 9, 2015 20:56
HTML | Tel Tag
<a href="tel:1-555-555-5555">1-555-555-5555</a>
@nielsenrc
nielsenrc / wordpress-live-sweep.sql
Created September 10, 2015 14:39
Wordpress | Change URL in Wordpress Database During Domain Change
// turn privacy setting off in Wordpress
UPDATE wp_options SET option_value = "1" WHERE option_name = "blog_public";
//change home and siteurl values
UPDATE wp_options SET option_value = "http://www.domain2.com" WHERE option_name = "home";
UPDATE wp_options SET option_value = "http://www.domain2.com" WHERE option_name = "siteurl";
// sweep options, post_content, and guid for references to old url
UPDATE wp_options SET option_value = REPLACE(option_value,'www.domain1.com','www.domain2.com');
UPDATE wp_posts SET post_content = REPLACE(post_content,'www.domain1.com','www.domain2.com');
UPDATE wp_posts SET guid = REPLACE(guid,'www.domain1.com','www.domain2.com');
@nielsenrc
nielsenrc / wordpress-next-and-previous-posts.php
Created September 10, 2015 14:43
Wordpress | Next and Previous Posts Links
<?php next_posts_link('Older Posts'); ?>
<?php previous_posts_link('Newer Posts'); ?>
@nielsenrc
nielsenrc / google-publisher-and-authorship-tags.html
Last active September 17, 2015 15:23
Google | Publisher and Authorship Tags
<link href="" rel="publisher">
<link rel="author" href="" />
@nielsenrc
nielsenrc / wordpress-output-include-in-a-shortcode.php
Last active September 17, 2015 19:30
Wordpress | How to Output a PHP Include in a Shortcode
<?php
ob_start();
include ‘file.php';
$output = ob_get_clean();
$output = str_replace(array("\r", "\n"), '', $output);
return $output;
?>
@nielsenrc
nielsenrc / us-state-dropdown.html
Created September 17, 2015 20:10
HTML | US State Dropdown
<select>
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
<option value="DC">District Of Columbia</option>
@nielsenrc
nielsenrc / advanced-custom-fields-state-drop-down.txt
Created September 24, 2015 22:12
Advanced Custom Fields State Drop Downs
AL : Alabama
AK : Alaska
AZ : Arizona
AR : Arkansas
CA : California
CO : Colorado
CT : Connecticut
DE : Delaware
DC : District Of Columbia
FL : Florida
@nielsenrc
nielsenrc / shopify-use-shopify-api-to-bulk-import-301-redirects.php
Last active July 13, 2017 00:30
Shopify | PHP | Use Shopify API to Bulk Import 301 Redirects
<?php
// In Shopify go to Apps -> Private Apps to get API Key
// List of Redirects under Online Store -> Navigation -> Redirects
$api_key = "";
$password = "";
$store_subdomain = ""; //
$shopify_url = "https://" . $api_key . ":" . $password . "@" . $store_subdomain . ".myshopify.com/admin/redirects.json";
$array_of_redirects = array (
'[/from-uri]' => '[/to-uri]',
);
@nielsenrc
nielsenrc / md5.php
Created September 30, 2015 20:17
Wordpress | Create New Password to Add to DB
<?php echo md5('password');?>
@nielsenrc
nielsenrc / whm-cpanel-bash-unsuspend-user.sh
Created October 1, 2015 19:33
WHM | cPanel | Unsuspend User from Command Line
/scripts/unsuspendacct <user>