Tagged: blank template, title
Hi guys,
is it possible to add the title of a post/page to the template-blank.php somehow? We are re-using the file in the child theme for custom post types and would like to add the title before the content. I am no template programmer though, so I am at a loss on how to do that. I am hoping that you have that code at hand and would really appreciate the help :)
Cheers,
MIchael
Hey Michael,
Thanks for contacting us!
You can edit your page and enable title and breadcrumbs in Title bar under Layout section.
If you would like to add title to all pages using blank template, please try adding following code to bottom of Functions.php file of your child theme
add_action('ava_after_main_title','new_ava_after_main_title');
function new_ava_after_main_title(){
global $avia_config;
if ( $avia_config['template'] == "avia-blank" ) {
$page_title = "<h1 class='page-title'>". get_the_title() ."</h1>";
echo $page_title;
}
}
Best regards,
Yigit
Hi Yigit,
excellent! I would have added it directly to the file template-blank.php, but this also works.
Thanks for your help
Michael