Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View adamdoe's full-sized avatar
🏠
Working from home

Adam Doe adamdoe

🏠
Working from home
View GitHub Profile
if ( ! class_exists( 'theme_utilities' ) ) {
class theme_utilities {
public static function theme_function_one() { }
public static function theme_function_two() { }
}
}
@adamdoe
adamdoe / crud-taxonomy-meta-wordpress.php
Created June 29, 2018 18:30 — forked from alexx855/crud-taxonomy-meta-wordpress.php
CRUD custom taxonomy meta wordpress
<?php
add_action( '{taxonomy}_add_form_fields', 'add_feature_group_field', 10, 2 );
function add_feature_group_field($taxonomy) {
global $meta_name;
?>
<div class="form-field">
<label for="meta_name">Meta Name</label>
<input name="meta_name" id="meta_name" type="text" value="<?php echo $meta_name; ?>" size="40" aria-required="true">
@adamdoe
adamdoe / functions.php
Last active August 23, 2017 13:53
Get user of role type and add them into columns using Foundation.
/**
* Author : Doe
* @param string $role_type used for getting type of user.
*/
function get_team_members($role_type) {
$args = array(
'role' => $role_type,
'fields' => 'ID'
);
{
"folders": [
{
"folder_exclude_patterns": [
"wp-includes",
"wp-admin",
"wp-content/uploads",
".idea"
],
"path": "PATH HERE",
function add_alt_tags($content)
{
global $post;
preg_match_all('/<img (.*?)\/>/', $content, $images);
if(!is_null($images))
{
foreach($images[1] as $index => $value)
{
if(!preg_match('/alt=/', $value))
{
@adamdoe
adamdoe / current_page_share.php
Created June 1, 2016 20:24 — forked from eddt/current_page_share.php
Share Current Page via Facebook
<?php
/**
* Get the current Url taking into account Https and Port
* @link http://css-tricks.com/snippets/php/get-current-page-url/
* @version Refactored by @AlexParraSilva
*/
function getUrl() {
$url = isset( $_SERVER['HTTPS'] ) && 'on' === $_SERVER['HTTPS'] ? 'https' : 'http';
$url .= '://' . $_SERVER['SERVER_NAME'];
$url .= in_array( $_SERVER['SERVER_PORT'], array('80', '443') ) ? '' : ':' . $_SERVER['SERVER_PORT'];
@adamdoe
adamdoe / .WordPress
Created April 15, 2016 13:18 — forked from artes-visuales/.WordPress
WordPress
//Theme Structure
header.php ...................... Header Section
index.php ......................... Main Section
sidebar.php .................... Sidebar Section
single.php ....................... Post Template
page.php ......................... Page Template
comments.php .................. Comment Template
search.php ...................... Search Content
searchform.php ............ Search Form Template
archive.php ................... Archive Template