Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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
    Dan

    #1085886

    Hey 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,
    Victoria

    #1088608

    Hi 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.
    #1090290

    Hi,
    To add a page title automatically above the page content, but below the title bar, first, add this shortcode to your functions.php

    function 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;

    This is the results:
    2019-04-13-011605

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.