Skip Navigation

[Resolved] Adding a layout in the functions php file

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wanted to know if they could assign a layout to a post using php.

Solution:

Unfortunately we don't have a function for this , so it wouldn't be possible to assign a layout from here.

This support ticket is created 6 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 2 replies, has 2 voices.

Last updated by jonathanB-16 6 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#908037

Is it possible to add a layout via php in the functions.php file?

I am adding custom tabs to my WooCommerce products and I would like to display layouts within the tabs.

I was able to successfully print Types fields using the below code, but was wondering if it was possible/how I would go about adding a layout instead, as I am not skilled in php coding:

function the_ingredients_custom_tab_content( $slug, $tab ) {
?><?php echo(types_render_field( 'directions', array( 'arg1' => 'val1', 'arg2' => 'val2' ) )); ?><?php
}

Thanks,
Jonathan.

#908559

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Jonathan,

Thank you for contacting our support forum.

Unfortunately we don't have a function for this , so it wouldn't be possible to assign a layout from here.

Thanks,
Shane

#910933

Ok, thanks for letting me know. I have coded it with php into the template instead (i.e. created the layout with divs etc).