Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #523403

    Hi
    Sorry to bother you, but i might have an odd question. I am using a Enfold child theme

    When i assign page templates e.g. template-xxx.php to pages with Avia Layout content it perfectly integrates and displays the Avia content in the (static/php) template content.

    I use a constuct i found here to create individual single post pages depending on a category flag by altering functions.php with

    add_filter('single_template', create_function(
    	'$the_template',
    	'foreach( (array) get_the_category() as $cat ) {
    	    
    		if ( file_exists(dirname(__FILE__) . "/single-{$cat->slug}.php") )
    		return dirname(__FILE__) . "/single-{$cat->slug}.php"; }
    	return $the_template;' )
    ); 

    In my case this template file is called single-person.php and looks roughly like this

    <?php
    global $avia_config, $more;
    get_header();
    echo avia_title();
    do_action( 'ava_after_main_title' );
    	 ?>
    SOME STATIC CONTENT
    <?php
    the_post();
    the_content();
    ?>
    SOME STATIC CONTENT
    <?php get_footer(); ?>

    The static content from the “single post template” is displayed fine when the post is edited in default editor. As soon as i turn on the Avia Layout, the static content (i guess the template) disappears / get overridden. Do you have an idea for a single-<categoryslug>.php template that works with Avia Layout? I would not want to miss it.

    Thank you in advance. Best j

    • This topic was modified 9 years, 9 months ago by princebilly.
    #523763

    Anyone got an idea ?

    #523997

    Hi!

    When you use the layout builder the /enfold/template-builder.php will be used instead.

    Best regards,
    Elliott

    #524094

    Hi Elliott

    Thank you for the hint. I’ll look into that. I learned without copying and changing files of the Enfold theme in a Child theme this won’t be possible. I wan’t to stay consistent with future updates as much as possible.

    I now used custom post types instead and registered the Avia Layout Builder for it. With this approach i am able to use Avia short code in Default Editor. By switching back and forth i can build a resulting single post and use it with a custom post template. Should anyone be interested – this workaround is fine for me.

    Thanks again for your reply. Love the theme.

    • This reply was modified 9 years, 9 months ago by princebilly.
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Child- Avia layout content overrides post (NOT page) template content’ is closed to new replies.