This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.log | |
.htaccess | |
sitemap.xml | |
sitemap.xml.gz | |
wp-config.php | |
wp-content/advanced-cache.php | |
wp-content/backup-db/ | |
wp-content/backups/ | |
wp-content/blogs.dir/ | |
wp-content/cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_last_updated() | |
{ | |
$post_time = strtotime(get_post_time('m.d.Y')); | |
$mod_time = strtotime(get_post_modified_time('m.d.Y')); | |
$mod_date = get_the_modified_time('m.d.Y'); | |
$date = get_the_date('m.d.Y'); | |
$display_date = ($post_time < $mod_time ? $mod_date : $date); | |
if ($post_time != $mod_time) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"folders": [ | |
{ | |
"folder_exclude_patterns": [ | |
"wp-includes", | |
"wp-admin", | |
"wp-content/uploads", | |
".idea" | |
], | |
"path": "PATH HERE", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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' | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/****************************************************************** | |
* Admin Footer | |
******************************************************************/ | |
function change_admin_footer(){ | |
echo '<span id="footer-note">Theme made by <a href="http://www.yourcompany.com/" target="_blank">Your Company</a>.</span>'; | |
} | |
add_filter('admin_footer_text', 'change_admin_footer'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ES6 Classes | |
* Notes: | |
* - instead of adding methods to the prototype | |
* can add them directly to class. | |
*/ | |
class Animal { | |
constructor(name, age) { | |
this._name = name; | |
this._age = age; |
OlderNewer