Tagged: read more button
-
AuthorPosts
-
January 21, 2022 at 10:13 am #1336509
Hi,
I have long been wanting to work on “read more sections on my page. The idea is that on click a section opens up below the text, not that the button takes you to another page. I can seem to make it work in the advanced builder, although there the option seems to be thereJanuary 22, 2022 at 3:07 pm #1336660Hey metafora29,
Thank you for your patience, do you mean that you would like to manually create a hidden text section on your page that will be shown when a button or link is clicked like a toggle or accordion section?
An example of this would be to use this css:.learn-this { display: none; } span.click-learn-more { color: #000; font-weight: bolder; } span.click-learn-more:hover { cursor: pointer; }
this html in a code block element:
<span class="click-learn-more">Learn more…</span> <span class="learn-this"> your hidden text </span>
and this script in your child theme functions.php:
add_action('wp_footer', 'ava_custom_script', 10); function ava_custom_script(){ ?> <script> (function($) { $('.click-learn-more').on('click', function() { $('.learn-this').toggle(); }); }(jQuery)); </script> <?php }
If you mean that you would like the “read more” from the blog element to behave like this, then unfortunately we can not do this.
You could use the masonry element or the ajax portfolio as a solution.Best regards,
MikeJanuary 25, 2022 at 7:01 pm #1337147Hi Mike
Thanks for your answer. I forgot to turn on the email notification of your reply so I only just saw it now. Tomorrow I will be investigating more and come back to you if the solution at hand it not enough.
Thanks again.January 26, 2022 at 12:40 pm #1337257Hi,
Thanks for the update. We’ll keep this thread open for you.
Best regards,
RikardJanuary 26, 2022 at 8:14 pm #1337356Hi rikard
It works, Thank you!
But I wonder if instead of just the text “Learn More…” I could insert a button? I tried to do it via short code, but it does not work….January 27, 2022 at 5:26 am #1337397 -
AuthorPosts
- You must be logged in to reply to this topic.