Thursday, September 14, 2023

How to add additional class to WordPress navbar anchors

 

//Function In function .php

function add_additional_class_on_a($classes, $item, $args)
{
    if (isset($args->add_a_class)) {
        $classes['class'] = $args->add_a_class;
    }
    return $classes;
}
add_filter('nav_menu_link_attributes', 'add_additional_class_on_a', 1, 3);

//Code for Header.php

 <?php

                $web_menu = wp_nav_menu(array(

                'theme_location' => 'menu-1',

                'menu_id' => 'primary-menu',

                'menu_class' => 'navbar-nav',

                'add_a_class' => 'nav-link', //Here is the class

                 'container' => 'ul',

                'echo' => false

            )

            );

            $web_menu = str_replace('menu-item', 'nav-item', $consult_menu);

                echo $web_menu ;

            ?>

Friday, September 1, 2023

What is WordPress Uses?

 In WordPress, "Users" refer to individuals who have access to your WordPress website's admin area. Each user account can have different roles and permissions, which determine their level of access and what they can do on the website. Managing user accounts is essential for controlling who can make changes to your site's content and settings. Here's an overview of WordPress users and user roles:

  1. User Roles:

    • Administrator: Administrators have full control over the WordPress site. They can add, edit, or delete content, install plugins and themes, manage other users, and change site settings. There can be multiple administrators.
    • Editor: Editors can create, edit, publish, and delete all types of content on the website, including posts, pages, and media. They cannot modify website settings or install plugins or themes.
    • Author: Authors can create, edit, publish, and delete their own posts. They do not have access to other users' content or settings.
    • Contributor: Contributors can write and edit their own posts, but they cannot publish them. They need an editor or administrator to review and publish their content.
    • Subscriber: Subscribers have the least access. They can only manage their user profile and receive email notifications about new content.
  2. Managing Users:

    • To manage users, log in to your WordPress Dashboard and go to "Users."
    • You can add new users, edit existing user profiles, change their roles, and reset passwords if necessary.
    • Be cautious when assigning roles. Only grant the level of access required for each user's responsibilities to maintain security.
  3. User Registration:

    • By default, WordPress allows users to register on your site. You can enable or disable user registration in the "General Settings."
    • Registered users can comment on posts, and you can also assign roles to new users upon registration.
  4. Multisite:

    • In WordPress Multisite, there are Super Admins who have control over the entire network, and there are site-specific admins for each sub-site within the network.
  5. User Profile:

    • Each user has a profile where they can edit their personal information, set their profile picture (avatar), and change their password.
  6. User Plugins:

    • WordPress allows you to extend user management through various plugins. For example, membership plugins can help restrict content to specific user groups, and social login plugins allow users to log in with their social media accounts.

User management is crucial for ensuring the security and integrity of your WordPress website. By assigning appropriate roles and permissions to users, you can maintain control over who can create, edit, and manage content while keeping your site protected from unauthorized changes.

1 hour Free Service for WordPress website :)

      1 hour Free Service for WordPress website :)