Tagged: wrapper
-
AuthorPosts
-
September 4, 2019 at 8:59 pm #1134091
Hi,
I’m trying to modify the pagecontent shortcode. I already created a copy in my child theme and tried to modify the output so that a wrapper div is going around all the page content that is shown. However, the wrapper div always gets added to the end of the first color section that is in the page that gets included.Problem seems to be that this is not doing what I thought:
$content = '<div class="page_content_wrapper">'; $content .= Avia_Builder()->get_posts_alb_content( $entry->ID ); $content .= '</div>';
It seems the content always gets parsed through some stuff and so my wrapper only gets included and not really wrapped.
How do I get a wrapper around this?
It would also help if I would find a way to wrap a wrapper around several colour sections so I could achieve my design :)Thanks to all enfold ninjas that could give me a hint!
Cheers Sascha
September 8, 2019 at 9:01 pm #1135724Hey saschapi,
$content .= Avia_Builder()->get_posts_alb_content( $entry->ID );
replace this with
.= get_the_content( $entry->ID );
and let us know if this works
Best regards,
BasilisSeptember 9, 2019 at 12:25 pm #1135952Hi Basilis,
this results in a timeout error:
Fatal error: Maximum execution time of 30 seconds exceeded in /www/htdocs/w019bb9d/webroot/wp-includes/shortcodes.php on line 447
Maybe you got another idea? :)
Cheers and thanks for your efforts.
SaschaSeptember 11, 2019 at 6:15 am #1136902Hi,
Thank you for the update.
Have you tried using the “avf_template_builder_content” filter instead of editing the template-builder.php file directly?
Example:
add_filter('avf_template_builder_content', function($content) { $output = '<div class="page_content_wrapper">'; $output .= $content; $output .= '</div>'; return $output; }, 10, 1);
Best regards,
IsmaelSeptember 11, 2019 at 4:08 pm #1137091This would wrap EVERYTHING on a page. But I need to wrap only a couple of coloursections. :-/
September 12, 2019 at 4:10 am #1137342Hey!
This would wrap EVERYTHING on a page.
I thought that’s what you’re trying to do based on your previous modification. You might be able to use the jQuery appendTo function to move any specific sections inside another container.
// https://api.jquery.com/appendTo/
You can create the wrapper or div dynamically, then move the sections inside it.
// https://api.jquery.com/insertAfter/
Regards,
IsmaelSeptember 12, 2019 at 7:05 pm #1137637I know that I could do it with JavaScript, but I’d rather have it in the code itself. Especially because of performance…
September 13, 2019 at 6:21 am #1137797Hi,
Unfortunately, that’s not possible. You can’t extract specific part of the post content, at least not without doing significant alterations in the theme. Why do you need to wrap these sections? Maybe we can achieve what you’re trying to do using a different approach.
Thank you for the update.
Best regards,
IsmaelSeptember 13, 2019 at 9:07 am #1137831Hi Ismael,
I know that it is not easy, but I have run into this issue several times in the past and right now it is the only good solution.
My task is to build a custom slider into a one pager that consists of several color sections. I have added a link to an example below. This is currently done by having 4 fullwidth columns inside a color section. But this limits the usage to fullwidth content. I need every slide to be a color section so I can do some more flexible stuff inside with the columns.I’m aware that this is some customisation which is probably not covered by your support policy, that’s why I will for sure do it myself, I just need the right hint :) My best guess was, that It is possible to wrap all content of the “include another post” shortcode with a div with a class. But unfortunately the color section logic will break all my attempts (see above).
I’m 100% sure this will be useful for others as well :) Do you have any other ideas how to achieve this?
Cheers and thanks for looking into it
SaschaSeptember 16, 2019 at 3:57 am #1138642Hi,
Thank you for the update.
Have you tried using the Layer Slider? That should satisfy your requirements. However, you have to purchase a regular Layer Slider license because the “play by scroll” feature is not available in the theme license.
// https://layerslider.kreaturamedia.com/sliders/play-by-scroll/
You can also append a set of sections inside the “scrollmagic-pin-spacer” container using JavaScript as suggested above.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.