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
// Add a widget in WordPress Dashboard | |
function wpc_dashboard_widget_function() { | |
// Entering the text between the quotes | |
echo "<ul> | |
<li>Release Date: March 2012</li> | |
<li>Author: Aurelien Denis.</li> | |
<li>Hosting provider: my own server</li> | |
</ul>"; | |
} | |
function wpc_add_dashboard_widgets() { |
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
add_action('wp_dashboard_setup', 'wpc_dashboard_widgets'); | |
function wpc_dashboard_widgets() { | |
global $wp_meta_boxes; | |
// Today widget | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); | |
// Last comments | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); | |
// Incoming links | |
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); | |
// Plugins |
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 is_post_type($type){ | |
global $wp_query; | |
if($type == get_post_type($wp_query->post->ID)) return true; | |
return false; | |
} |
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
add_filter('excerpt_length', 'my_excerpt_length'); | |
function my_excerpt_length($length) { | |
return 20; } |
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 | |
global $wp_query; | |
if( empty($wp_query->post->post_parent) ) { | |
$parent = $wp_query->post->ID; | |
} else { | |
$parent = $wp_query->post->post_parent; | |
} ?> | |
<?php if(wp_list_pages("title_li=&child_of=$parent&echo=0" )): ?> | |
<ul class="nav nav-list"> |
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 | |
if (function_exists('register_sidebar')) { | |
register_sidebar(array( | |
'before_widget' => '<li id="%1$s" class="widget %2$s">', | |
'after_widget' => '</li>', | |
'before_title' => '<h2 class="widgettitle">', | |
'after_title' => '</h2>', | |
)); | |
} |
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_users` SET `user_pass` = MD5( 'new_password_here' ) WHERE `wp_users`.`user_login` = "admin_username"; |
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
/* =WordPress Core | |
-------------------------------------------------------------- */ | |
.alignnone { | |
margin: 5px 20px 20px 0; | |
} | |
.aligncenter, div.aligncenter { | |
display:block; | |
margin: 5px auto 5px auto; | |
} |
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 fb_add_custom_user_profile_fields( $user ) { | |
?> | |
<h3><?php _e('Extra Profile Information', 'your_textdomain'); ?></h3> | |
<table class="form-table"> | |
<tr> | |
<th> | |
<label for="address"><?php _e('Address', 'your_textdomain'); ?> | |
</label></th> | |
<td> | |
<input type="text" name="address" id="address" value="<?php echo esc_attr( get_the_author_meta( 'address', $user->ID ) ); ?>" class="regular-text" /><br /> |
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
// Load up the theme options. Put this line in your functions.php file | |
require_once ( get_template_directory() . '/theme-options.php' ); | |
<?php | |
add_action( 'admin_init', 'theme_options_init' ); | |
add_action( 'admin_menu', 'theme_options_add_page' ); | |
/** |