How To Reverse Highlight With jQuery In WordPress
The following snippet will let you reverse highlight with jQuery in WordPress.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
jQuery(document).ready (function() { jQuery("li.menu-item > a").hover( function () { jQuery(".menu-item > a").not(this).animate({ opacity: .5 }, 0, 'linear', function() { }); }, function () { jQuery(".menu-item > a").animate({ opacity: 1.0 }) } ); }); |
How To Set Basic Tag Cloud In WordPress
The following line of code will let you set basic tag cloud in WordPress.
1 |
<?php wp_tag_cloud('smallest=8&largest=16&'); ?> |
How To Set Default Editor In WordPress
Adding the following snippet to your theme’s functions.php file will let you set default editor in WordPress.
1 2 3 4 |
# This sets the Visual Editor as default # add_filter( 'wp_default_editor', create_function('', 'return "tinymce";') ); # This sets the HTML Editor as default # add_filter( 'wp_default_editor', create_function('', 'return "html";') ); |
How To Set Login And Password In WordPress
The following snippet will let you set login and password in WordPress.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
<div id="barra-login"> <p> <?php global $user_ID; if ( $user_ID ) : ?> <?php global $current_user; get_currentuserinfo(); ?> <?php if( !empty($current_user->display_name) ){ $nome = $current_user->display_name; } elseif( !empty($current_user->first_name) && !empty($current_user->last_name) ){ $nome = $current_user->first_name." ".$current_user->last_name; } else { $nome = $current_user->user_login; } ?> Welcome, <strong><?php echo $nome; ?></strong> [ <a href="<?php echo get_option('home')?>/painel/">My Dashboard</a> | <a href="<?php echo wp_logout_url( htmlentities(get_option('home')) ); ?>" title="Logout">Logout</a> ] <?php else : ?> <strong>Welcome Visitor!</strong> [ <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=register&redirect_to=<?php echo get_option('home')?>/my-information/">Join us</a> | <a href="<?php echo get_option('siteurl'); ?>/wp-login.php">Log</a> ] <?php endif; ?> </p> </div> |
How To Set Role And Capabilities In WordPress
The following snippet will let you set role and capabilities in WordPress.
Add this capabilities for every custom post type.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
[edit_post] => "edit_{$capability_type}" [read_post] => "read_{$capability_type}" [delete_post] => "delete_{$capability_type}" [edit_posts] => "edit_{$capability_type}s" [edit_others_posts] => "edit_others_{$capability_type}s" [publish_posts] => "publish_{$capability_type}s" [read_private_posts] => "read_private_{$capability_type}s" [delete_posts] => "delete_{$capability_type}s" [delete_private_posts] => "delete_private_{$capability_type}s" [delete_published_posts] => "delete_published_{$capability_type}s" [delete_others_posts] => "delete_others_{$capability_type}s" [edit_private_posts] => "edit_private_{$capability_type}s" [edit_published_posts] => "edit_published_{$capability_type}s" edit_members read_members delete_members edit_memberss edit_others_memberss publish_memberss read_private_memberss delete_memberss delete_private_memberss delete_published_memberss delete_others_memberss edit_private_memberss edit_published_memberss |