Alternative Navigation Style using CSS3 animations and transitions.
This file contains hidden or 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 lipsum_shortcode($atts) { | |
extract(shortcode_atts(array('amount' => 1, 'type' => 'paras'), $atts)); | |
$lipsum = simplexml_load_file("http://www.lipsum.com/feed/xml?amount=$amount&what=$type")->lipsum; | |
return $lipsum; | |
} | |
add_shortcode('lipsum', 'lipsum_shortcode'); |
This file contains hidden or 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
// In options.php | |
$options[] = array( | |
'name' => __('Example Hide', 'options_framework_theme'), | |
'desc' => __('Example Hide Multiple Fields', 'options_framework_theme'), | |
'id' => 'example_showhidden', | |
'type' => 'checkbox'); | |
$options[] = array( | |
'name' => __('Example Hidden 1', 'options_framework_theme'), |
This file contains hidden or 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 is_logged_in($atts, $content){ | |
if(is_user_logged_in()){ | |
return do_shortcode($content); | |
} | |
else { | |
// this is used incase you want to attach an icon/message to show more information is available on login | |
return "<span class='secured'></span>"; | |
} | |
} |
This file contains hidden or 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
/* Set Default Mail From Name */ | |
function custom_wp_mail_from_name( $original_email_from ){ | |
return 'Danny Wilson'; | |
} | |
add_filter( 'wp_mail_from_name', 'custom_wp_mail_from_name' ); | |
/* Set Default Mail From email */ | |
function custom_wp_mail_from( $original_email_address ){ | |
return '[email protected]'; | |
} |
This file contains hidden or 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 | |
// Add this into wp-db.php at line 954 | |
if ( isset( $tables['options'] ) && defined( 'CUSTOM_OPTIONS_TABLE' ) ) | |
$tables['options'] = CUSTOM_OPTIONS_TABLE; | |
?> | |
<?php | |
// Add this to your wp config file | |
define('CUSTOM_OPTIONS_TABLE', 'api_options'); | |
?> |
This file contains hidden or 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
/* Switch off comments and remove for already created posts */ | |
UPDATE {{database}}.{{prefix}}posts SET comment_status = 'closed' WHERE comment_status = 'open'; | |
UPDATE {{database}}.{{prefix}}options SET option_value = 'closed' WHERE option_name = 'default_comment_status'; | |
/* Lost password on localhost/no mail server */ | |
UPDATE {{database}}.{{prefix}}users | |
SET password = MD5('{{password}}') | |
WHERE user_id = 1; /* normally replace with relevant user ID */ | |
/* Somethings broke - deactivate all plugins and use default theme */ |
This file contains hidden or 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 iadw_get_ordinal_suffix($number){ | |
$ends = array('th','st','nd','rd','th','th','th','th','th','th'); | |
if (($number %100) >= 11 && ($number%100) <= 13) | |
$abbreviation = $number. 'th'; | |
else | |
$abbreviation = $number. $ends[$number % 10]; | |
return $abbreviation; | |
} |
This file contains hidden or 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 iadw_login_redirection(){ | |
auth_redirect(); | |
} | |
add_action( 'wp_head', 'iadw_login_redirection' ); | |
/* to allow visitors to access your home page only just switch the function to | |
* if(!is_home()) auth_redirect(); | |
*/ |
This file contains hidden or 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 | |
/* add this on init hook */ | |
register_taxonomy_for_object_type( 'category', 'attachment' ); | |
?> |
OlderNewer