Hi, I had a problem a while ago, whereby on one content template, if there was a conditional shortcode wrapping a section of the content, none of the shortcodes would parse. Here is the old thread: https://toolset.com/forums/topic/shortcodes-not-parsing/
That was only on one host, and I ended up moving to another for unrelated reasons, and there was no longer a problem. Well that new host has now rebooted their server, changed all sorts of PHP configuration, and now I have the same problem again!
The conditional statement is important because it displays the content only if that post does not have the custom field "hidden". What I would like to know now is, if there is another way, maybe in functions.php, to designate a different content template if the post has the field, "hidden"?
Thank you
Hi,
It seems to be a server problem, we need to know if there is any PHP error occur in your website, please check these first:
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/
Hi, as in the previous instance on another server, the error is only actually a notice, but it is:
Notice: Undefined offset: 1 in /etc/etc/public_html/wp-content/plugins/wp-views/embedded/inc/wpv-shortcodes.php on line 4452
It is a live site and I can't unfortunately carry out the tests you suggest, but I have done all of that previously. This error only occurred after the server was upgraded from Cloud Linux to CentOS with EA4, which is most likely the same now as the other server where the error occurred previously. I could get the PHP info if it would help, but unfortunately I don't now have access to what it was before. Thank you
I checked the PHP source codes of the latest version of Views plugin, file wp-views/embedded/inc/wpv-shortcodes.php on line 4452, there isn't related codes you mentioned above.
Are you using the latest version of Views plugin?
If not please try to upgrade it to the latest version, and test again.
You can download it here:
https://toolset.com/account/downloads/
And I suggest you backup your website before the upgrading.
Thank you, yes all of my plug-ins are up to date. Views is currently 2.3.1. I just downloaded the file in question and that particular line seems to be
Is that as it should be?
In the latest version of Views plugin 2.3.1, file wp-views/embedded/inc/wpv-shortcodes.php on line 4452, it is:
Which is different from what you mentioned above.
That's very odd, sorry I don't know how that happened but have now uploaded the plugin by FTP and the error is now on line 4799, which in fact is exactly the same code, but now further down.
Since this problem only exists in your website, we need to check the compatibility problem and server problem, Please try this:
1) Duplicate same problem in another test website by follow our document:
https://toolset.com/faq/how-do-i-migrate-a-wordpress-site-from-one-domain-to-the-other/
2) deactivate other plugins and switch to wordpress default theme, and test again
3) If the problem still exists, provide the credentials of your test site in below "private detail box".
Thanks for the details, I can login your website, please point out the problem page URL, where and how can I see the problem, which shortcode should be parsed?
I just test it in your website, for example, in the content template "Single - Property", line 4~6, add below three lines:
<hr />
wpcf-hidden: [wpv-post-field name = "wpcf-hidden"]
<hr />
You can remove it anytime you want.
and test the a "house" post in front-end, I can see above shortcodes has been parsed correctly.
For the new question "the undefined index notices", the [wpv-conditional] won't work within the shortcode [wpv-for-each], please check our document:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-for-each
Note: wpv-conditional shortcode won’t work inside a wpv-for-each shortcode
So the codes you mentioned above will not works as expected