I even tried using "isset", but sadly it is not working.
function pageBanner($args=NULL){
if(!$args['title']){
$args['title']=get_the_title();
}
if (!$args['subtitle']){
$args['subtitle'] = get_field('page_banner_subtitle');
}
if (!$args['photo']){
if (get_field('page_banner_background_image')){
$args['photo'] = get_field('page_banner_background_image')['sizes']['pageBanner'];
}
else {
$args['photo']=get_theme_file_uri('images/pages.jpg');
}
}?>
I didn't know the problem on my if(!$args['title']){
$args['title']=get_the_title();
it is working, but the subtitle and photo are undefined index.