Skip Navigation

[Résolu] Show two separate layouts on front page

This support ticket is created Il y a 6 années et 7 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 5 réponses, has 2 voix.

Last updated by Ole Andreas Vekve Il y a 6 années et 7 mois.

Assisted by: Minesh.

Auteur
Publications
#564455

Hello,

I am trying to add to separate views into the front page / Home page.

They are both added in separate layouts, but I am having some troubles displaying them at the same time on the front page.

One View shows post type Tjenester, and the other one shows Ansatte.

They are added the following way in index.php:
<?php the_ddlayout( 'tjenester-front-page' ); ?>
<?php the_ddlayout( 'ansatte-front-page' ); ?>

They are not added

#564706

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Could you please share edit screenshot of both the layout or temporary access details so that I can check what you have added with both the layouts?

#564837

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - I just contacted our developers and they said its not a good practice to display two layouts on the single page and this might not work as well.

I checked with your install and I see that you are displaying view's cell with both the layout. The suggested approach is to create the single layout and add view's cell to display both views using single layout. I hope this makes sense to you.

#564853

Hello again,

Thanks for checking that out.

I was worried about that, is there an other way I can display 2 views or archives like this into the same page without adding them to the same layout? I am wondering about this because this would really solve the problem.

Looking forward to hear from you again,

#564998

Minesh
Supporter

Languages: Anglais (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - View's PHP API you can display the multiple views but you can use with or without layout. Either disable both view's using PHP API or display one view using layout and one view using PHP API.

For example:

$args = array(
    'id' => '99999',
    
);
echo render_view( $args );

Where:
- 99999 is the view ID your want to display. You should replace it with your original view ID.

More info:
=> https://toolset.com/documentation/programmer-reference/views-api/#render_view

#565235

Thank you,

Great, short and specific. That really solves the problem.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.