Skip Navigation

[Resolved] Problem with third-party shortcode in Content Template

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.

This topic contains 4 replies, has 2 voices.

Last updated by Eric 7 years, 9 months ago.

Assigned support staff: Caridad.

Author
Posts
#192119

I have a Content Template that has an area with three columns. In the left column, I'm displaying values from a Types custom field group. In the middle column I'm displaying a feed from an rss aggregator via shortcode. In the third column I'm trying, but failing, to display more values from another Types custom field group.

It seems that something is happening after the shortcode for the aggregator fires that's preventing the next shortcodes for custom field values to display. The section looks like so:

<div class="one-third first">
            <h2 class="cur-issue"><a href="/current-issue">Current Issue</a></h2>
            <div class="even-height">
                <h5><a title="Current Issue" href="/current-issue/">[types field="home-col-current-issue-head" output="raw"][/types]</a></h5>
                [types field="home-col-current-issue-content" output="raw"][/types]
            </div>
          
          <a class="button" href="/download-the-app">Download the App</a>
        </div>
        <div class="one-third">
            <h2 class="news"><a href="/news">News Feed</a></h2>
          <div class="even-height">
            [wp-rss-aggregator limit='2' excerpts='yes' thumbnails='no' date='no']
          </div>
          	
          <a class="button arrow" href="/news">Read More</a>
        </div>
        <div class="one-third">
            <h2 class="report"><a href="/report-on-business">Report on Business</a></h2>
            <div class="even-height">
                <h5><a href="/report-on-business">[types field="home-col-report-on-business-head" output="raw"][/types]</a></h5>
              	[types field="home-col-report-on-business-content" output="raw"][/types]
			</div> 
            
          <a class="button" href="/report-on-business">View the Report</a>
      </div>

I know there's not a problem with the custom fields in the third column. I tested them by moving them into the first column, and they displayed fine. Basically, any Types custom fields after the custom shortcode fail.

Any ideas how to fix that?

Thanks,
Eric

#192711

Dear Eric,

There is a problem in the way that the plugin is restoring the query. Edit the file wp-rss-aggregator/includes/feed-display.php and add this after line 238:

wp_reset_query();

This goes just after this line: $wp_query = $old_wp_query;

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

Regards,
Caridad

#192827

Hi Caridid,

I added that line, but it didn't have any affect.

Thanks,
Eric

#192838

As a test, I moved the News feed to the third column so the RSS query happens last. I'll see if my client will settle for that rather than trying to track down this bug...

#193042

Hi Caridad,

My client is ok with rearranging the columns so that the offending aggregator plugin shortcode executes last. It's not fixed, exactly, but is no longer a problem, so I'll call it "resolved." I appreciate your looking into it.

Thanks for your time.
Eric