[Résolu] Underline the current page out of a vpwiev list
This support ticket is created Il y a 8 années et 1 mois. 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.
with a filter, I am visualising a menu of pages from a certain category.
This is working fine.
Now I would like to underline (or anyway change the css of the font) the post-link of the current page.
For example, having a list of pages as a menu:
Page1, Page2, Page3
I would like to have Page2 with a different color when the user is actually viewing Page2.
Please notice that you may need to use some custom code to grab the current page URL or Slug and then compare it with the current item in loop. Please see following resources:
If you are using a custom short code or function to achieve this, remember to register your function or short code under Views -> Settings -> Compatibility -> {relevant section for short code or function}
Can you please use [wpv-post-link] and output of the current_post_title() without the [wpv-conditional]? So you can compare if both are returning the identical values.
This correctly outputs the post-link as italic, but twice. If I put it inside the loop then they will all come out formatted.
I need an else-if statement to make it work but i have no idea how to do it.
Please notice the 2 [wpv-conditional] short codes used within the loop. The first condition checks if the slug of the post in loop matches the current_post_slug(), then it outputs just the Post Title. The second conditional checks if it does not matches (not equal to), then it outputs the Post Link.
This is how you actually take advantage of an else-if part, which is not available in [wpv-conditional].
Can I ask for a temporary access to your site? So I can look for more details.
I have enabled your next reply as private, please input all details in that area. Please mention the links to the pages, views, forms, CPTs and configurations in question.
Please take a backup of your site, before proceeding.
I have looking into your theme and Views from WPAdmin, but looks like I need to see the code for current_post_slug() function also. I may also need to add/alter some code in functions.php. I don't see the Editor and Plugins enabled via the access you provided.
I have set your next reply as private again, please allow me to edit functions.php via WPAdmin or FTP. As well as, the access to plugins page.
Unfortunately, I am not able to edit any of the file (in plugin folder as you mentioned), nor under the theme's folder. So I can not edit the function or can implement some code experiments to make it work.
Please make either of the locations writable so I can proceed further.
I've logged in with your credential and I was able to read and write the files.
I've reset the server permissions anyway. This should work now, as on the server side everything looks good. Could you try again? thanks