-
AuthorPosts
-
December 1, 2018 at 9:29 pm #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?
December 2, 2018 at 10:25 am #1039869Hey bobfurgo,
You could try to override index.php in your child theme.
Best regards,
RikardDecember 2, 2018 at 8:00 pm #1040026Hi Rikard,
Thank you, i’m not sure how to go about doing that…would you mind elaborating?
Thanks so much,
December 3, 2018 at 7:19 am #1040151Hi,
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,
RikardDecember 3, 2018 at 7:36 am #1040155What do I add to the index.php file though?
December 3, 2018 at 2:48 pm #1040319December 3, 2018 at 6:01 pm #1040422Yes, but i’m not sure what code to place here.
please see private area
December 6, 2018 at 7:39 pm #1041805just wanted to follow up on this, thank you
December 10, 2018 at 2:54 am #1042867Hi,
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,
IsmaelDecember 17, 2018 at 9:06 pm #1046539Hi 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 :)
December 19, 2018 at 3:08 am #1047084Hi,
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 -
AuthorPosts
- You must be logged in to reply to this topic.