Skip Navigation

[Closed] Alter the Views Template

This support ticket is created 4 years, 2 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
- 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 replies, has 2 voices.

Last updated by Minesh 4 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#2074653

Tell us what you are trying to do?
I want to create a php template file, the same as we use for post types, and render the tool view result there. This will give us flexibility, as we can use PHP to preprocess the response, instead of using the front end editor found in the views page.
Is there any documentation that you are following?
Toolset Forums
Is there a similar example that we can see?
On Drupal only.
What is the link to your site?
hidden link

#2074661

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Toolset view offers the PHP API function render_view() using which you can display the view within your PHP template file.

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

#2075799

I see.
I've tried the functions in the page you linked, I am able to print the query results, but it seems without the custom fields. Is there a way to load custom fields for the posts in the query result?

#2075809

Minesh
Supporter

Languages: English (English )

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

Sorry what custom fields? did you added the custom fields to the view's Loop Editor section?

#2078245

Custom fields were added in the Views Loop Editor, yes.

However, when using get_view_query_results function, it returns only basic info such as content ID, title and content. No custom fields are returned.

#2078799

Minesh
Supporter

Languages: English (English )

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

Can you please share problem URL where you added your view and where exactly you added the view PHP function as well as admin access details.

Also, please clarify what fields you want to display with the viewe?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

The topic ‘[Closed] Alter the Views Template’ is closed to new replies.