Skip Navigation

[Resolved] loop editor heading displaying incorrectly

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 7 replies, has 1 voice.

Last updated by Minesh 4 weeks ago.

Assisted by: Minesh.

Author
Posts
#2808974

I am trying to: Recreate the Tour page on hidden link on a staging server

Link to a page where the issue can be seen: hidden link

I expected to see: The header I have in the loop editor should only show each month once followed by all the tour dates in that month.

Instead, I got: this code repeated on the web page for every tour date entry (month changes depending on entry date):
[heading condition="month" value="February"]
February
[/heading]

#2808996

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Thank you for sharing admin access details but when I try to login to admin using the shared admin access details I get the following error message:

Error: The username anneakiko11stg is not registered on this site. If you are unsure of your username, try your email address instead.

Can you please send me worknig admin access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) 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.

#2809059
#2809145

Minesh
Supporter

Languages: English (English )

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

Well - I do not find the [heading] shortcode with your stating site.

With your production site are you using [heading] shortcode? if yes:
- with your production site check the theme's functions.php file or "Custom Code" section or any custom code snippets plugin you use try to locate the [heading] shortcode and add that to your staging site's custom code section.

If you can share production site access details I can check that for you. For that I need admin access details of your production site.

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

#2809321
Screenshot 2025-05-18 at 10.18.15 PM.png

Hi - The header code is within the Toolset Views called "Tour Dates on Tour page View" and "Tour Dates on Tour page Next Year only" that both have the code below that includes the heading which I have been using successfully for several years:

[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop wrap="1" pad="true">

[heading condition="month" value="[types field='date-of-tour-event' style='text' format='F'][/types]"]
<h3 class="tour-date-month">[types field='date-of-tour-event' style='text' format='F'][/types]</h3>
[/heading]

[wpv-item index=1]
<div class="row ">
<div class="col-sm-12">[elementor-template id="2183"]</div>
</div>
[wpv-item index=other]
<div class="col-sm-12">[elementor-template id="2183"]</div>
[wpv-item index=pad]
<div class="col-sm-12"></div>
[wpv-item index=pad-last]
<div class="col-sm-12"></div>
</div>
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]

#2809379

Minesh
Supporter

Languages: English (English )

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

Yes but you should check where the "heading" custom shortcode is added.

Is it with your theme's functions.php file or at Toolset Custom code section or somewhere else?

#2809643

Toolset view is linked from Elementor template id="2186" "Tour Dates Page Template" found on WP page "Tour Dates". Here is a link to that template: hidden link

#2809679

Minesh
Supporter

Languages: English (English )

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

Well - I need the custom shortcode "heading" where you added that with your live site?

Can you please grant me access to your live/production site so that I can search for the heading custom shortcode.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) 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.

#2809779
#2809877

Minesh
Supporter

Languages: English (English )

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

As you can see with your live/production site's child theme's functions.php file:
=> hidden link

There is a custom shortcode added to it:

add_shortcode('heading', 'func_filter_by_month');
  
function func_filter_by_month($atts, $content = '') {
  static $year = null;
  static $month = null;
  $condition = $atts['condition'];
  $value = $atts['value'];
  switch ($condition) {
    case 'year':
    case 'month':
      if ($$condition != $value) {
        $$condition = $value;
        return $content;
      }
      break;
  }
  return '';
}

You will require to add the above custom "heading" shortcode to your stating site's curreht theme's functions.php file or you can add it to "Custom Code" section offered by Toolset:
=> https://toolset.com/documentation/programmer-reference/adding-custom-code/

Once you add the above custom "heading" shortcode, you should be able to see the result and rendered heading shortcode output.