Ask questions about WordPress courses

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_widget' => '
  • ', 'before_title' => '

    ', 'after_title' => '

    ', ));

    Good luck in developing user-friendly sites on CMS WordPress.


    Купить хостинг WordPress
    WordPress tutor
    Online tutoring services. List of courses I teach
    • Basic web design course;
    • Site layout;
    • General course on CMS WordPress and continuation of the course on template development;
    • Website development in PHP.
    Read more on the page WordPress tutor
    */

    Nikolaenko Maxim

    Director of web studies ProGrafika. I am developing, website design and promotion. Always glad to new blog readers and good clients.


    You may also like...

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Templates for WordPress
    The best hosting in Ukraine
    Stable hosting for Drupal