Any news on this topic? I need to display a random line of text (out of 5-7 options). Any input would be much appreciated!
l_s
Posts
-
Random intro image -
Make project thumbnails unclickable or even use custom link.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 :)
-
Wrapper div around multiple elements on one pageFor anyone interested, since the help here is clearly limited:
As there seems to be no way to create a wrapper, I solved the problem with:
# Method ".row:nth-child(NUMBER)"
# Applied to my accordion this looks like: jQuery(document).on("click touchstart", ".accordion-toggle-3", function() { jQuery(".row:nth-child(21)").nextUntil(".row:nth-child(25)").slideToggle();
Here .accordion-toggle-3 is the class of the element to be clicked to execute the toggle. This can also be bound to an event changing e.g. a + into a - for showing the current state (open/closed).
Good luck!
-
Wrapper div around multiple elements on one page@mariusjopen Yes, as described I would like to have an accordion on a page. I have 3 categories out of which I just want one opened and two closed at a time.
I've tried working with Jquery slideToggle and Tree Traversal.
First, I managed to trigger all elements with a certain class I assigned. That method left out certain placeholder/grid elements in between. Plus, I have assign a class manually to a lot of elements. That's referring to my original question: WP simply closes any open tag I've inserted when adding html in gridder (e.g. <div> will be turned into <div></div>.My current approach is using nextUntil because it doesn't seem to be possible to wrap multiple elements in one div in Laytheme, without touching the js core of the theme.
<script>
jQuery(document).on("click", "#accordion-toggle-1", function() { jQuery("#accordion-toggle-1").nextUntil("#accordion-toggle-2").slideToggle(); });
</script>However, this approach only toggles one single elements, which is the first sibling in the div of the element #accordion-toggle-1. The code runs perfectly well in an isolated environment.
Does this help to understand my issue?
-
Wrapper div around multiple elements on one page@mariusjopen Still stuck with this topic. Unfortunately not. I also tired several shortcodes plugin and can't get any of the accordions to work. Is there one that has been tested with laytheme?
-
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!
-
Problems with Plugin "YOAST SEO"Still the same here… Gridder disappears as soon as Yoast is activated. Any ideas (or alternatives?)
-
Wrapper div around multiple elements on one page@mariusjopen Yes, I found that one but is there a way to group them as in putting a wrapper div around multiple elements so that all elements become a child? Otherwise th accordion won't collapse the elements as a whole but rather collapse them individually, if you know what I mean.
-
Wrapper div around multiple elements on one pageHi @mariusjopen, thanks for your message. Yes, I read it and changed my script accordingly.
The accordion seems to be running but as I was trying to say I can't figure out how to apply it to multiple elements at once vs. only one gridder block, which I can easily assign a class to via the right click menu.
But nevertheless, I think this is more html related, isn't it? Any idea how to solve the wrapper situation? -
Wrapper div around multiple elements on one pageHi Armin and Marius,
I've implemented a js-accordion into a page but I'm having trouble creating a wrapper element around multiple elements/blocks of the page to trigger a whole group at once.
I've tried adding simple html blocks in gridder before (<div class="wrapper">) and after (</div>) the elements but it automatically closes the start div to (<div class="wrapper"></div>).
Is there any other way to do this?
Many thanks in advance!