-
AuthorPosts
-
April 1, 2019 at 11:23 am #1085432
Hi there
I’ve searched the forum but not been able to find anything on this.By default the H1 gets displayed in the bar that includes the breadcrumb above the page content. I know this can be hidden, but what’s the best way to get this <h1> displayed in the actual page template body (ie. in the main ‘template-page content’ class?) so that it still gets outputted automatically but just in a different area.
I am using a child theme so would be potentially be up for overriding a template file.
best
DanApril 2, 2019 at 7:19 am #1085886Hey Dan,
If you’re building your posts and pages via the Avia Layout Builder you need to add the header manually as a special heading tag, for example. If you’re using the Classic editor there could be the way to automate it.
Best regards,
VictoriaApril 9, 2019 at 10:11 am #1088608Hi Victoria – adding the H1 manually really isn’t ideal. Which php file is responsible for generating ‘standard’ pages that have been built using ALB?
The ‘which template’ plugin always display ‘template-builder.php’ which is clearly not what we’re looking to edit, but surely there’s a way to pull the H1 so that it’s in the ‘template-page content’ area?
thanks
Dan- This reply was modified 5 years, 7 months ago by danno99uk.
April 13, 2019 at 7:18 am #1090290Hi,
To add a page title automatically above the page content, but below the title bar, first, add this shortcode to your functions.phpfunction page_title_sc( ){ return '<h1 class="container">'. get_the_title() . '</h1>'; } add_shortcode( 'page_title', 'page_title_sc' );
Then edit: \enfold\template-builder.php on lines 100-102, look for:
$content = apply_filters('the_content', $content); $content = apply_filters('avf_template_builder_content', $content); echo $content;
and change to:
$content = apply_filters('the_content', $content); $content = apply_filters('avf_template_builder_content', $content); echo do_shortcode("[page_title]"); echo $content;
Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.