Make project thumbnails unclickable or even use custom link.
-
(Picking up on Re: Project thumbnails - disable links on specific elements)
Hi all,
I've been trying to create a one-pager website, showing a selection of projects with the project gridder so that I don't need to do everything manually and can control the selection via categories.
Now I tried via css to make the links unclickable but this disables the hover as well. Now I'm wondering whether there's a way to remove the href entries via JS or use the code snippet plugin and override the php structure.
Even better would be exchanging the href with a a custom link. I need a mailto: using the project's title as its ?subject and one linking to a mailchimp signup prompt in a modal or new page.Any ideas? @mariusjopen @arminunruh maybe? @fabiofrl did you get any further insight on the topic?
Any input highly appreciated, many thanks!
-
-
For anyone interested, since the help here is clearly limited:
In the end, I solved the issue with the Plugin "Code Snippets", which I use to execute a php redirect, coming into play whenever a post (in Laytheme = projects) is loaded:
add_action('template_redirect', 'proj_redirect_to_home'); function proj_redirect_to_home() { global $post; if (is_single() && $post->post_type=='post') { $redirect_title = urlencode(get_the_title()); wp_redirect( esc_url('https://www.domain.com/contact-order/') .'?subject='.$redirect_title ); exit(); } }
Now I redirect to a form, which sits on a separate page. The form is generated by Contact Form 7, which needs to be extended by another plugin called Contact Form 7 - Dynamic Text Extension, to use the dynamic field get parameter. This should be more comfortable than a mailto.
Then, I have a footer activated for all projects, where I have the following function added as a html snippet in the gridder:
<script> window.laytheme.on("newpageshown", function(layoutObj, type, obj){ if(type == "project"){ location.reload(); } }); </script>
Since Laytheme runs as a single page app, the page needs to be refreshed to execute the redirect.
This can also be done by editing Laytheme's frontend.app.js but that's more complicated plus you get issues while updating, obviously.Cheers :)
-
Dear @l_s
cool!We give our best to help. But when it goes into more deep problem solving – we cannot help everywhere.
Thank you for sharing!
Best!
Marius
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it