Skip Navigation

[Resolved] Child Post No Longer Reading Info Correctly From Parent Post

This support ticket is created 7 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 7 replies, has 2 voices.

Last updated by Luo Yang 7 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#438839

Hi there,

I sell theatre tickets on my website.

I have Show and Venue pages (post types).

The Show page (Child) pulls info from the Venue page (parent).

The Show page consists of a main area and sidebar.

In the sidebar I have the following widgets:
- Wp Views Content Template: which displays various info from the page and pulls in the Venue name
- WP Views: which displays more info pulled in from the Venue page (parent)

It is the code in the WPViews which is no longer working as it used to.

It has 3 elements:

- Venue Name & Address: Instead of pulling the information from the parent/venue page to which the show belongs to, it is just pulling up the information for the first parent/venue in the list
- Map: As above, it is reading the map address of the first parent/venue in the list.
- Seating Plan URL: It is not gathering this at all and instead displays the current post id url

Link to a show page: hidden link
(The Arts Theatre is the first Venue in the list and displays across all the Show pages - this is wrong.)

What I should get is the same Venue name as the one displayed above on the same page. In this instance, it should be the Prince Edward Theatre.
The correct address for the venue should display with the correct map location. In this instance, it should read 'Old Compton Street, W1D 4HS'
And if the Seating Plan url was being read correctly, a pop up for the relevant venue would appear.

This is the code:

<!-- wpv-loop-start -->
		<wpv-loop>
          <h3>Venue Information</h3>
          [wpv-post-link id='$venue']
          
<br>
[types field='theatre-address' id='$venue'][/types]
[symple_spacing size='10px']
[symple_googlemap title="[wpv-post-title id='$venue']" location="[types field='theatre-address' id='$venue'][/types]" zoom='13' height='250']  
[symple_spacing size='20px']
          <center>Click here for <a href="[types field="seating-plan-url" id='$venue' raw='true'][/types]">SEATING PLAN</a></center>

		</wpv-loop>
	<!-- wpv-loop-end -->

This code has worked perfectly for the last 3 years and now it doesn't. Can you please advise?

#439159

Dear Chantal,

In the debug information you provided, there isn't Views and Types plugin in your website.

I suggest you try these:
1) you are using the latest version WP-TYPES plugins, you can download them here:
https://toolset.com/account/downloads/
2) deactivate other plugins and switch to wordpress default theme, and test again
3) Enable PHP debug mode, copy and paste the debug logs here
PHP Debugging
In case you think that Types or Views are doing something wrong (what we call a bug), you should enable PHP error logging. Again, edit your wp-config.php file and add the following:

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
This will produce a file called ‘error_log.txt’ in your WordPress root directory. Make sure that the web server can create and write this file. If it cannot, use an FTP program to create the file and make it writable to Apache (normally, user www-data).
https://toolset.com/documentation/user-guides/debugging-types-and-views/

#440773

Hi Luo,

Thanks for your response but I am a little confused. Did you only look at the debug information I sent you and not the link? If you had looked at the source code you would have seen Toolset/Types/Views on that page.

I'm not sure why the debug information states what it does, as I have copied and pasted from within the plugin, which is working perfectly throughout my whole site apart from the code I have detailed above which is no longer working.

I have the latest versions of Types and Views installed. They are Network Activated and have been for the last 3 years my site has been online.

Deactivating all plugins and using a test is not an option. As aforementioned, the plugins are installed and activated and my site is heavily dependent on them in sections. This is a business site and I can't just switch it off when the plugin is installed, activated and working across the site.

For clarification, this is how I obtained the debug as the instructions on the Toolset site are out of date:

Toolset > Views > Show Page Map (name of view) > Help > Toolset Debug

I have clicked on it again and I can see Toolset in the debug code. How can I send this to you privately? There is no option here.

#441144
1014.jpg

In the Debug information you provided, I can not find the Types and Views plugins, see screenshot 1014.jpg.
And I checked the HTML source codes of URL just now:
view-source:hidden link
I can find the CSS files from Types and Views plugins. but I am not sure which version of the Types and Views plugin are you using.

The problems you mentioned above is abnormal, and I can not duplicate them in my localhost, since you are using other plugins, so there might be compatibility problem in your website, as I mentioned above, please try these:

1) deactivate other plugins and switch to wordpress default theme, and test again
2) Enable PHP debug mode, copy and paste the debug logs here
PHP Debugging
In case you think that Types or Views are doing something wrong (what we call a bug), you should enable PHP error logging. Again, edit your wp-config.php file and add the following:

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
This will produce a file called ‘error_log.txt’ in your WordPress root directory. Make sure that the web server can create and write this file. If it cannot, use an FTP program to create the file and make it writable to Apache (normally, user www-data).
https://toolset.com/documentation/user-guides/debugging-types-and-views/

If you need assistance for it, please backup your database, fill below "private detail box" with admin login details and ftp access of your website, I need test and debug in a live website. thanks

#442713

Hi Luo,

I will get this information to you shortly.

But before I do this, can you confirm that the Views code I am using is still correct? I have several other Views across the whole site and they are all working as they should. Just want to check that there is nothing wrong with the actual code I am using. Thanks.

(Please ensure the private information box is still enabled.)

#442923

I can not find anything wrong in your codes, and the private information box is enabled again.

#444629

Thanks for the details, I am checking in your website, will feedback if there is anything found

#444635

Here is what I found:
1) The test site you provided is a sub site of wordpress multiple site installation, and you provided a admin account of sub site, it is not a network admin, I can not deactivate plugins and switch theme, so I can not make sure if there is any compatibility problem in your website

2) In the the debug logs:
hidden link
As you can see, there are lots of PHP warning/errors in the debug logs, for example:

[08-Oct-2016 03:51:42 Europe/London] PHP Warning:  strpos(): Empty needle in /dom7210/wp-content/plugins/wordpress-seo-premium/premium/classes/redirect/class-redirect-handler.php on line 342

This is a error from another plugin "wordpress-seo-premium".

As I mentioned above, here might be compatibility problem in your website, please try one of below options:
1) deactivate other plugins and switch to wordpress default theme, then I can test and debug it in your test site.
2) you can provide a network admin account, I can deactivate plugins.
3) follow document:
https://toolset.com/faq/provide-supporters-copy-site/
provide a copy of your website, then I can test and debug in my localhost without breaking your test site.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.