Skip to content

Instantly share code, notes, and snippets.

Edwin Velez edwinvelez

Block or report user

Report or block edwinvelez

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View my-plugin.php
<?php
/**
* Create an array of strings based upon this plugin's root directory directory (not web root). Each index
* of the array is delimited by the file system path for this file. This file may, or may not be, located in
* a subdirectory of a plugin's source files.
*/
$this_file_relative_path = explode( '/', plugin_basename( __FILE__ ) );
$this_plugin_directory_url = plugins_url( $this_file_relative_path[ 0 ] );
View functions.php
<?php
/**
* Edwin Velez
*
* Starting point for all WordPress themes.
*
* @package EdwinVelez
* @author Edwin Velez (https://edwinvelez.net)
* @license GPL-2.0-or-later
@edwinvelez
edwinvelez / genesis-build-sidebar-toc.js
Created Jun 14, 2019
Build Table of Contents in Sidebar of a Genesis Theme
View genesis-build-sidebar-toc.js
/**
* Scans for <h1> to <h6> HTML tags contained within 'genesis-content' and builds a Table of Contents in the primary
* sidebar.
*
* @summary Dynamically builds a Table of Contents for in page navigation.
* @author Edwin Velez (edwinvelez.net)
*
* @version 1.0.1
*/
@edwinvelez
edwinvelez / external_links.js
Last active Apr 25, 2019
Open External Links in New Tab
View external_links.js
@edwinvelez
edwinvelez / functions.php
Created Mar 13, 2019
Set Reading Settings on Theme Activation
View functions.php
<?php
/**
* Set Reading Settings on Theme Activation
*
* @author Edwin Velez (https://edwinvelez.net)
* @link https://edwinvelez.net/set-reading-settings-on-theme-activation/
*/
function ev_set_reading_settings() {
@edwinvelez
edwinvelez / functions.php
Last active May 20, 2019
Compare Two Domain Name Values
View functions.php
<?php
/**
* Compare Two Domain Name Values
*
* @author Edwin Velez (https://edwinvelez.net)
* @link https://edwinvelez.net/compare-two-domain-name-values/
*/
// The domain name or host you want to compare. Can also be a host i.e. http://localhost
@edwinvelez
edwinvelez / functions.php
Created Mar 13, 2019
Set Reading Settings Programmatically
View functions.php
<?php
/**
* Set Reading Settings Programmatically
*
* @author Edwin Velez (https://edwinvelez.net)
* @link https://edwinvelez.net/set-reading-settings-programmatically/
*/
// Set static front page.
@edwinvelez
edwinvelez / unattended_mysql_install.sh
Created Apr 28, 2017
Completes an unattend installation of MySQL with phpMyAdmin.
View unattended_mysql_install.sh
#!/bin/bash
#
# Author: Edwin Velez
# Author URI: edwinvelez.net
# Description: Completes an unattend installation of MySQL with phpMyAdmin.
MYSQL_HOST=“localhost”
MYSQL_PASSWORD="Password"
PHPMYADMIN_APP_PASSWORD="Password"
PHPMYADMIN_MYSQL_PASSWORD="Password"
@edwinvelez
edwinvelez / wp_install.sh
Created Apr 4, 2017
Bash Script to Install WordPress from a Local Machine to Remote Server
View wp_install.sh
#!/bin/bash
# Update variables as needed.
SSH_REMOTE_INFO="username@remotehost"
WP_HOME_DIR="path/to/remote/wp/homedir"
DB_NAME="db_name"
DB_USER_NAME="db_user_name"
DB_USER_PASS="db_user_pass"
DB_HOST="localhost"
SITE_URL="http://example.com"
You can’t perform that action at this time.