Join our new community forum for support & discussion

Join Now

Home Support Themes TaskHive User role page personalization

User role page personalization

  • Author
    Posts
  • elioberga

    Hi;
    is it possibile with a snippet to hide the button “List a service” just for certain kind of users? For example the administrator can see it while a normal subscriber would not see it. I managed to hide it with this snippet and it works, but I don’t know how to filter it just for “Subscriber” role:

    add_action( ‘wp_head’, function () { ?>
    <style>

    .hp-menu–site-header button {
    display:none;
    }

    </style>

    Thank you.

    elioberga

    And how do you redirect to a certain home page/hide certain page basing on the role after the login? I should install a user management plugin or Hivepress permit it? if so, which one is compatible?

    Thanks.

    ihor developer

    1. The best way would be overriding this template part https://github.com/hivepress/hivepress/blob/master/templates/listing/submit/listing-submit-link.php and adding “current_user_can(…” to the “if” condition. You can override it by placing this file in /hivepress/listing/submit/ subfolder of the child theme (please don’t place it in TaskHive directly because updates will erase any direct changes). Also, you don’t have to add any “wp_header” actions to add CSS snippets, you can simply put them in Appearance/Customize/Additional CSS field.

    2. HivePress always redirects users to the first page in the account menu. For vendors, it’s “Listings” page (with Marketplace extension it’s seller’s “Dashboard”), for regular users it’s “Settings” page. Redirecting users to custom landing pages would require some customizations.

    ihor developer

    P.S. Please consider leaving the default HivePress role system, because hiding some UI for regular users wouldn’t allow them to become sellers. I don’t know what’s the business model of your marketplace, but if you hide the “List a Service” button and a regular user decides to become a seller later this button will be hidden (and it’s the only way to list a service), user would have to contact you directly and ask to change the account role. You can already decide who can become a seller by approving/rejecting listings.

Viewing 4 posts - 1 through 4 (of 4 total)

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.