Tagged: templates
Hi,
What code can I add to my functions.php file to hide the Templates button from non-admins in the Avia Layout Builder?
Thank you!
Hey!
Try adding this at the very end of your theme / child theme functions.php file:
add_action('admin_head', function() {
if( !current_user_can('activate_plugins') ){
?>
<style>.avia-template-save-button-container{ display: none; } </style>
<?php
}
});
Cheers!
Josue
Thank You!!
I have one other question. The pages I am hiding the buttons on are Portfolio pages that we have already set up for each user. We only want the user to make changes, not add a bunch of stuff, so I have hid nearly all of the elements to restrict what can be done ( I found that solution on another post). So, the only thing left to hide is the “Default Editor” button. I don’t want anyone to get confused if they click that and see a blank page. My only concern was that, for some reason, the page might open up in Default Editor mode and they might need to click on the button to get back to the Avia Layout Builder. Is this a concern? If not, how would I hide that button?
Thanks again!
Hey!
Try with the following CSS code:
a#avia-builder-button {
display: none;
}
Best regards,
Josue
Thank You!
You are welcome, glad to help :)
Regards,
Josue