Skip Navigation

[Resolved] Stop fields outside of filter duplicating in a View

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

Last updated by Ben 5 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#1160176

Ben

Imagine I have a view and I use the following:

    <wpv-loop>
      [wpv-post-title]
      
      [types field='custom-field' item='$current_page'][/types]
    </wpv-loop>

[wpv-post-title] displays the Post Titles of the results from the query and [types field='custom-field' item='$current_page'][/types] displays a custom field from the page that the View is inserted on.

Now, if the results of the query return more than one result it will display these different results (as expected), but it will also duplicate the [types field='custom-field' item='$current_page'][/types] value so it is displayed the same amount of times as the results from the query using [wpv-post-title].

Is this expected behaviour?

Is there any way I can stop the [types field='custom-field' item='$current_page'][/types] duplicating in these circumstances?

I hope I have managed to explain the above clearly. Please let me know if you need anything clarified.

#1160576

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Yes - that is expected behavior as you have added the shortcode that displays the current page field value within the view's loop.

You should try to add that shortcode outside the views loop. For example:

<wpv-loop>
  [wpv-post-title]
   </wpv-loop>
 [types field='custom-field' item='$current_page'][/types]
#1160813

Ben

Thank you Minesh! That has worked perfectly.