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
//http://www.wpinsite.com/code-snippets/how-to-get-the-name-of-the-current-wordpress-page-template | |
//https://wordpress.org/support/topic/get-name-of-page-template-on-a-page | |
/** | |
* Get the name of the current page template name. | |
* @return string | |
*/ | |
function get_page_template_name() { | |
if(is_page()) { | |
global $post; | |
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 | |
//Drop this in your functions.php file in a safe place | |
//Change all references to "borough" or "Borough" to the taxonomy you need (pay attention to the correct capitalization) | |
//Then save the edited functions.php | |
//Find this new filter in: WP Admin > Events > Settings > Filterbar | |
//Docs for TribeEventsFilter: http://docs.tri.be/Filter-Bar/class-TribeEventsFilter.html | |
// | |
// | |
//This addresses adding/registering the taxonomy to WordPress and the filter functionality to Events Calendar Pro Filter Bar in one shot | |
// |
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
# Compiled source # | |
################### | |
.pict | |
.svg | |
.gif | |
.jpg | |
.swf | |
.fla | |
.flv | |
.psd |
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
//How to edit a user profile on the front end? | |
//http://wordpress.stackexchange.com/questions/9775/how-to-edit-a-user-profile-on-the-front-end | |
//Forcing nickname as display_name in custom edit profile template | |
//http://wordpress.stackexchange.com/questions/35403/forcing-nickname-as-display-name-in-custom-edit-profile-template | |
/////// | |
<?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
//http://designgala.com/how-to-change-wordpress-theme-directly-from-database/ | |
UPDATE wp_options SET option_value = 'default' WHERE option_name = 'template'; | |
UPDATE wp_options SET option_value = 'default' WHERE option_name = 'stylesheet'; | |
UPDATE wp_options SET option_value = 'default' WHERE option_name = 'current_theme'; |
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
//http://wordpress.org/support/topic/transfer-multisite-to-another-server | |
//http://halfelf.org/2012/moving-wordpress-multisite/ | |
//http://codex.wordpress.org/Moving_WordPress | |
//http://www.realisingdesigns.com/2010/09/16/moving-the-domain-of-a-wordpress-multisite-install/ | |
UPDATE wp_options SET option_value = replace(option_value, 'www.production.com', 'beta.development.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'www.production.com', 'beta.development.com'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'www.production.com', 'beta.development.com'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'www.production.com', 'beta.development.com'); |
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
# | |
#http://wordpress.stackexchange.com/questions/74924/disable-author-pages-for-specific-users | |
# | |
function tst() { | |
global $wp_query; | |
if (is_author() && !empty($wp_query->query['author_name'])) { | |
$author = get_user_by('login',$wp_query->query['author_name']); | |
if ( 1 === $author->ID) { | |
wp_safe_redirect(get_bloginfo('url'),'301'); // or whatever you want | |
} |
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
// Naturally, this is relative to each theme, | |
// you're going to have to hunt to figure out | |
// what the items are called in your functions.php | |
// of parent theme or framework code | |
// theme prefix = most likely your theme folder name | |
// Read these threads for context... | |
// http://wordpress.org/support/topic/overriding-twentyeleven-theme-optionsphp | |
// http://stackoverflow.com/questions/8994887/how-to-remove-wordpress-theme-options-from-child-theme | |
// http://codex.wordpress.org/Function_Reference/remove_submenu_page |
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
/* Now wrapped in an if statement, checking for information to tag onto url even exists in current dom. | |
It also now encodes parentheses. | |
It was failing silently on some pages and wasn't sure why but it's fixed now. | |
I think the pinterest plugin uses multiple links and so I'm only targeting the .pin-it-button class link specfcally now. | |
I also chained a bunch of .txt stripping (.replace()) events together */ | |
if(jQuery("div.specifications").length > 0){ | |
//target the anchor/image link in the selector we're focused on... | |
var pinTarget = jQuery(".sdjpip_linkbox a.pin-it-button"); |
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 | |
function dateConvert($x_date){ | |
$x_date = explode('/', $x_date, 4); | |
$x_months = array('','January','Febuary', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); | |
$x_month = intval($x_date[0]); | |
$x_day = intval($x_date[1]); | |
$x_year = $x_date[2]; | |
return ($x_months[$x_month]." ".$x_day. ", ".$x_year); | |
}``` |
NewerOlder