Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1039736

    Hello,

    I’d like to add an element to the blog post pages but am not using the advanced layout. Is there a way to do this?

    #1039869

    Hey bobfurgo,

    You could try to override index.php in your child theme.

    Best regards,
    Rikard

    #1040026

    Hi Rikard,

    Thank you, i’m not sure how to go about doing that…would you mind elaborating?

    Thanks so much,

    #1040151

    Hi,

    You can copy the index.php file to your child theme, then add what you need to add in that file inside of your child theme.

    Best regards,
    Rikard

    #1040155

    What do I add to the index.php file though?

    #1040319

    Hi,

    You can open that file in a text editor for instance.

    Best regards,
    Rikard

    #1040422

    Yes, but i’m not sure what code to place here.

    please see private area

    #1041805

    just wanted to follow up on this, thank you

    #1042867

    Hi,

    You can add this code somewhere in that file.

    $the_id = 23;
    $post = get_post( $the_id );
    $content = Avia_Builder()->compile_post_content( $post );
    echo $content;
    

    If you want to add it on a single post page, you have to modify the single.php or the includes > loop-index.php file.

    Best regards,
    Ismael

    #1046539

    Hi Ismael,

    I’m still a bit confused, sorry if I’m misunderstanding or missing something!

    I want to add this to every blog post page. It is a an element I saved as a template called “CTA”. How do I specify this template be added to the bottom of every blog post page? If you could elaborate or break it down a bit more it would be much appreciate. Thanks :)

    #1047084

    Hi,

    If it’s a template, use this filter to add it to every single post item or blog post page.

    add_filter('avf_template_builder_content', 'avf_template_builder_content_render_templates', 10, 1);
    function avf_template_builder_content_render_templates($content)
    {	
        $name = 'CTA';
        $id = AviaStoragePost::get_custom_post('template_builder_snippets');
        $template = get_post_meta( $id, '_avia_builder_template_cta' );
        $shortcodes = str_replace('{{{'.$name.'}}}','',$template[0]);
    
    	if( is_singular('post') )
    	{
    		$content = $content . do_shortcode($shortcodes);
    	}
    
    	return $content;
    }

    Best regards,
    Ismael

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