Hello. Thank you for contacting the Toolset support.
1)
Could you please share problem URL?
2)
*** 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 would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).
I have set the next reply to private which means only you and I have access to it.
Hm. I have re-viewed the code, and I personally cannot see any syntax errors.
None are fixed either, the active class is still not added to the current page.
And yes, that is exactly what i am trying to achieve.
I've added the following code to your view's JS box.
jQuery(document).ready(function($){
href = window.location.href;
x = href.split('/');
x = x[x.length-2];
var locations = new Array("omsorgscentret.dk", "hvem-kan-faa-hjaelp", "formaal","vi-tilbyder");
current = locations.indexOf(x) + 1;
$('#main-nav li:nth-child('+current+')').addClass('active');
});
Could you please check your issue and confirm this solution help you to resolve your issue.
I will NOT take this solution as "resolved". - Actually im very disapointed that you bring up this hotfix for a solution.
Making a jQuery solution to the problem is not a fix.. Or at least, its not a fix i want to use at all.
It does not answer the question i posted, that the conditional statements are not working properly.
Thanks for your try, but i will not accept this as a solution - i could have done this myself but i want a solution for the future. If the Conditional statements doesnt work properly in Views, how dare someone to bring a jQuery fix to it? Im sorry but this fix had me a little bit upset, as i did not at all expect this as a serious solution to why Conditional is not working.
Also you have hardcoded the URL names into a array, which for me seems useless. Do you expect the clients to add a new string to the array each time they add a new page?
Please, if it cant be fixed because of the code is wrong, REPORT it to the dev team instead of jQuerying around it..
On my local when I use [wpv-post-id id="$current_page"] shortcode it gives me right page ID.
However - on your install it's not working right. It seems to me that this is your live site. That's the reason I gave you the alternate solution. if you would not like to go with jQuery solution - never mind and I kindly apologise for same.
I would like to do some test with the default theme and with/without plugins.
Could you please give me test site or is it OK for you if I should make a test with this current site?
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.