-
AuthorPosts
-
March 1, 2016 at 12:45 pm #591492
Hi,
I´m trying to create a page template for a custom post type.
I have set builder mode to debug, constructed my pagelayout using the page builder elements and then copied the generated shortcode to my template.
In my custom post type I have some custom fields that I also include as variables inside the shortcode.
This has been working fine and certainly feels like a really convenient way of constructing customizations, but for some reason when I try to include a color section element in my shortcode then the layout breaks as I view pages based on my template.I have created a page called single-myCPTname and tried using both page.php and template-builder.php as base. Where inside template-builder.php would be the best place to paste my shortcode? …or I should I place it somewhere else?
Here are 2 simplified versions of the shortcode I´m trying to use (without my custom fields variables):
1. This one work as expected (displaying 2 columns)
echo do_shortcode(”
[av_one_half first min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='']
[av_textblock size='' font_color='' color='' custom_class='']
<h2>Test text1</h2>
[/av_textblock]
[/av_one_half][av_one_half min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='']
[av_textblock size='' font_color='' color='' custom_class='']
<h3>Test text2</h3>
[/av_textblock][/av_one_half]“);
2. This one wraps both the colorsection and the following text columns with the background image, there is also empty space added above the color section. (expected full width color section with background image and then below that, the two text columns)
echo do_shortcode(“[av_section min_height='25' min_height_px='500px' padding='default' shadow='no-border-styling' bottom_border='no-border-styling' id='' color='main_color' custom_bg='' src='https://www.enfold2.dev/wp-content/uploads/2016/02/myimage.jpg' attachment='3360' attachment_size='full' attach='scroll' position='top left' repeat='stretch' video='' video_ratio='16:9' overlay_opacity='0.5' overlay_color='' overlay_pattern='' overlay_custom_pattern='' custom_class='']
[av_textblock size='' font_color='' color='' custom_class='']
test text
[/av_textblock]
[/av_section][av_one_half first min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='']
[av_textblock size='' font_color='' color='' custom_class='']
<h2>Test text1</h2>
[/av_textblock]
[/av_one_half][av_one_half min_height='' vertical_alignment='' space='' custom_margin='' margin='0px' padding='0px' border='' border_color='' radius='0px' background_color='' src='' background_position='top left' background_repeat='no-repeat' animation='']
[av_textblock size='' font_color='' color='' custom_class='']
<h3>Test text2</h3>
[/av_textblock][/av_one_half]“);
Greatful for help with this, thanks!
March 4, 2016 at 11:08 am #593203Hi Dist!
Thank you for using Enfold.
Please provide a link to the custom post type page. Custom post types usually use the single.php file unless it finds a more appropriate template file to match the current query. More info on the following link: https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
Cheers!
IsmaelMarch 4, 2016 at 1:29 pm #593253Thank you Ismael,
Currently this is only on my localhost. I realize I need to do the custom coding myself but please advice me on what I´m doing wrong (I did try both single.php and single-portfolio as base for template but with the same results as above).
I was hoping I could use the generated shortcodes (via page builder debug mode) in my page template, and content would come from our custom fields -variables. This would mean a really powerful way of customizing sites for our clients and it “almost” works so far…
Reading other comments it seems to me I should be using template-builder.php as my base for our templates because of the fact I´m constructing a page based on pagebuilder -generated shortcode ?
Please see my original post on what I´m trying to echo as shortcode (constructed in a variable)
these lines on row 41… in template-builder seem important? How can I output my variable correct way?
$content = apply_filters(‘the_content’, $content);
$content = apply_filters(‘avf_template_builder_content’, $content);
echo $content;March 8, 2016 at 9:36 pm #595178Hey!
it would require a huge amount of time and customization of the theme and that is why you would need to hire a freelance developer for this job.
Cheers!
AndyMarch 11, 2016 at 9:22 am #596766Basically my question, do you have any recommendation on why shortcodes in my templates that includes full width colorsection seem to break the layout?
Not asking for any customizations
Thanks!March 11, 2016 at 1:39 pm #596858Hey!
can you provide us a link to your site showing the elements in question please? we need to be able to inspect the elements.
Regards,
Andy -
AuthorPosts
- You must be logged in to reply to this topic.