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
find . -type f -newer '[filename]' -print0 | xargs -0 -I {} cp {} [dirname] | |
# replace strings in a file without creating a backup. the -i parameter would create a backup if you so desired | |
sed -i '' 's/techliminal/localhost/g' [filename] | |
# find all the javascript files and list them | |
find . -name *.js -print | xargs ls -l | |
# change the owner of all the javascript files | |
# Looks like the sudo has to be on the xargs / chown part of the operation |
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 my_comment_listing($comment, $args, $depth){ | |
$GLOBALS['comment'] = $comment; ?> | |
<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>"> | |
<?php do_action( 'genesis_before_comment' ); ?> | |
<div class="comment-header"> | |
<div class="comment-author vcard"> |
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 | |
/** | |
* TL EVENTS | |
* | |
* Functionality for adding time, date for events, displaying them by week, etc. | |
* This assumes your events are posts in the "Events" category, but could easily be | |
* extended to other stuff. | |
*/ |
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
<!-- replace the below with this --> | |
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"> | |
<?php if (is_category(1)){ ?> | |
<img src="http://asdfha.jpg" class="header-image" width="" height="" alt="Header 5" /> | |
<?php } else { | |
$header_image = get_header_image(); ?> | |
<img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /> | |
<?php } ?> | |
</a> |
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 | |
/* When we're using the event calendar community feature, we need to disable any | |
widget areas that might be displaying extra copies of the form. In theory Modern | |
Tribe will fix this in a future release, but, in the meantime... */ | |
function check_for_event_calendar_pro_router_page(){ | |
global $wp_query; | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> | |
<meta charset="utf-8"> | |
<title>Google Maps JavaScript API v3 Example: Marker Simple</title> | |
<link href="https://developers.google.com/maps/documentation/javascript/examples/default.css" rel="stylesheet"> | |
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script> | |
<script> | |
function initialize() { |
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
/* if using this with Genesis, hook this after the loop. | |
The name of the custom field can be hidden, if you provide a metabox for choosing it. | |
The simplest thing is to leave it visible and just use the custom field selector. | |
*/ | |
function tl_attach_category(){ | |
global $post; | |
$attach_option = get_post_meta($post->ID, 'attach_category', true); | |
// You might want to do different things for different categories |
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
-- Life is better when you can cut and paste | |
-- Post meta | |
------------- | |
-- Site Options | |
------------- | |
select distinct option_name from wp_options; |
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
# This script is for shell users who have previously created a database. | |
mkdir ~/installs | |
cd ~/installs | |
wget http://wordpress.org/latest.zip | |
unzip latest.zip | |
cp wordpress/* ~/public_html/ | |
cd ~/public_html/ | |
cp wp-config-sample.php wp-config.php | |
vi wp-config.php |
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
-- handy for moving a database from prouction to your local environment. | |
-- change URL's in wordpress single-site install. Replace with your own URL's. | |
-- this doesn't address serialized options. | |
UPDATE wp_options SET option_value = "http://localhost:8888" WHERE option_name = "home"; | |
UPDATE wp_options SET option_value = "http://localhost:8888" WHERE option_name = "siteurl"; | |
update wp_postmeta set meta_value = replace(meta_value, 'http://example.com', 'http://localhost:8888') where meta_key='_menu_item_url'; | |
update wp_posts set post_content = replace(post_content, 'http://example.com', 'http://localhost:8888'); |