Skip Navigation

[Resolved] costume field group

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

Problem:

The issue here is that the user is displaying his custom posts using a php template and wanted to know how to display a view using php.

Solution:

This can actually be done using the function below.
https://toolset.com/documentation/programmer-reference/views-api/#render_view

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 10 replies, has 2 voices.

Last updated by shannonW 6 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#915425

I am trying to show the custom filed group on post page but it does not show.
For the single page, I use 'single-character-en.php' and for archive page, I use wp-archive (toolset).
I need php code to embed inside of my 'single-character-en.php' to show custom field group.

I tried these, but still not showing.
https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/
https://toolset.com/documentation/customizing-sites-using-php/displaying-repeating-fields-one-kind/

#915491

Shane
Supporter

Languages: English (English )

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

Hi Shannon,

Thank you for contacting our support forum.

Would you mind letting me know which field group you are having the issue with and also can I get admin access so that I can check on this field group.

Thanks,
Shane

#915528

Hello Shane,
thank you for the reply.

[Character posts]
Inside of character skills (custom fields) -> skill table (repeatable group).

Once you provide me an email, I will give you access (It can take some time because I need to send a request to the person who can give you an access).

Thank you 🙂

#915900

Shane
Supporter

Languages: English (English )

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

Hi Shannon,

You can use the email shane.c@onthegosystems.com

Thanks,
Shane

#916050

Shane
Supporter

Languages: English (English )

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

Hi Shannon,

I see what you want now.

You will need to display the field group using views but you can render the view template in php using the function below.
https://toolset.com/documentation/programmer-reference/views-api/#render_view

Please let me know if this helps.
Thanks,
Shane

#916298

I tried but still nothing showing up...

#916317

Shane
Supporter

Languages: English (English )

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

Hi Shannon,

Would you mind resending the credentials once more as I seem to have deleted it from the forum.

Thanks,
Shane

#916378

Shane
Supporter

Languages: English (English )

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

Hi Shannon,

I took a look at the site again and i'm not seeing where a view was created for the repeated field groups.

You will need to create a view to list the repeated fields.
https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/

Then you just add the view to the php template using this below.
https://toolset.com/documentation/programmer-reference/views-api/#render_view

Thanks,
Shane

#916407

Thank you for reply.
Sorry I forgot I delete the view area.
I add the view area and add these code in the 'single-character-en.php':

<div class="skill-row skill-row7">
<?Php
$skill_table = get_view_query_results( 5302 );
foreach ( $skill_table as $skill_tables ) {
echo $skill_tables->post_title;
}
?>
</div>

<div class="skill-row skill-row8">
<?Php
$skilltable = array(
'title' => 'skill-name'
);
echo render_view( $skilltable );
?>
</div>

<div class="skill-row skill-row9">
<?Php
echo render_view_template( 5302, $skilltable );
?>
</div>

but it just shows one line like this on the live page:
5285skill second row5214skill first row

I don't know.. what I am doing wrong...

#916716

Shane
Supporter

Languages: English (English )

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

Hi Shannon,

Could you try again?

You needed to have added the filter so that it knows which information to display using views.

Thanks,
Shane

#916748

it's working now 🙂

I suppose to write
'title' => 'skilltable'
not 'title' => 'skill-name'

Thank you for the help 🙂