Actions and Scripts WordPress
Removing Default WordPress Profile Fields. Code checked, everything is working.
add_filter('user_contactmethods','hide_profile_fields',10,1);
function hide_profile_fields( $contactmethods ) {
unset($contactmethods['aim']);
unset($contactmethods['jabber']);
unset($contactmethods['yim']);
return $contactmethods;
}Adding a Horizontal Line Button to the WordPress Visual Editor.
function enable_more_buttons($buttons) {
$buttons[] = 'hr';
return $buttons;
}
add_filter("mce_buttons", "enable_more_buttons");Custom sidebar for website homepage
To create a new sidebar, you need to create a file sidebar-home.php in the root folder of your template. We put the contents of the file into it sidebar.php.
And replace part of the sidebar code:
For this code:
Next, on the main page, replace the code:
to the code:
Next, in order to be able to add widgets to our new sidebar, you need to register it in WordPress using the register_sidebar function.
register_sidebar(array(
'name'=>'home-sidebar',
'id' => 'home-sidebar',
'before_widget' => '', 'after_title' => '
', ));Good luck in developing user-friendly sites on CMS WordPress.
/*

- Basic web design course;
- Site layout;
- General course on CMS WordPress and continuation of the course on template development;
- Website development in PHP.




