May 3, 2023 at 5:57 pm
#1406365
Hey BeeCee,
Try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:
function trigger_alb_on_load_for_page(){
?>
<script>
window.addEventListener('DOMContentLoaded', function() {
(function($){
if ($('body.wp-admin.post-new-php.post-type-page').length > 0){
setTimeout(function(){
$("#avia-builder-button").trigger('click');
},300);
}
})(jQuery);
});
</script>
<?php
}
add_action('admin_head-post-new.php', 'trigger_alb_on_load_for_page');
Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
In my test a timeout of 300 ms (less than half a second) is required for the ALB button to be available, so if this doesn’t work for you try increasing the “300” to a higher number.
Also ensure you are not deferring jQuery with a caching plugin or in theme options, such as Enfold Theme Options ▸ Performance ▸ Load jQuery in your footer
Best regards,
Mike