-
AuthorPosts
-
October 20, 2016 at 8:35 pm #702078
Hi, How can i create a “load more” button that after clicking it, it shows design element(box with content) like a color section?
October 20, 2016 at 9:35 pm #702096Hey Davipar,
Please enable the custom css class field: http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/ and edit your button element (which will be used as toggle button for your section) and give it “accsb” custom class.
Then edit your Color Section element and give it a unique ID “accs”.
Then add following code to Quick CSS in Enfold theme options under General Styling tab
#accs { display: none; }
And finally, add following code to Functions.php file in Appearance > Editor
function avia_custom_accs(){ ?> <script> jQuery(window).load(function(){ jQuery('.accsb a').click(function() { jQuery('#accs').slideToggle("fast"); }); }); </script> <?php } add_action('wp_footer', 'avia_custom_accs');
Best regards,
YigitOctober 20, 2016 at 11:07 pm #702125I’ve got two options:
funciona.php and functions_enfold.php
If i put this code: `function avia_custom_accs(){
?>
<script>
jQuery(window).load(function(){
jQuery(‘.accsb a’).click(function() {
jQuery(‘#accs’).slideToggle(“fast”);
});
});
</script>
<?php
}
add_action(‘wp_footer’, ‘avia_custom_accs’);`on functions_enfold.php my website turns white and does not work but if i put it on just functions.php it does not work too
October 21, 2016 at 9:51 am #702260Hi,
Please send us a temporary admin login and login URL so that we can have a closer look. You can post the details in the Private Content section of your reply.
Regards,
RikardOctober 21, 2016 at 10:44 am #702278Okey Just wordpress?
October 21, 2016 at 2:46 pm #702426Hi,
Login page is not loading on my end. Please make sure to add the code to functions.php file.
If that too does not help, please post FTP logins here privately as well.Best regards,
YigitOctober 21, 2016 at 3:19 pm #702459Where are you from? My hosting server block non spanish countries.
I will give you access after it.
Thank you!October 22, 2016 at 8:52 am #702752Hi,
Moderators are located all over the world so if you could lift that ban for a few days until we resolve your problem it would be great.
Thanks,
RikardJune 13, 2019 at 12:55 pm #1109851hey there,
i´ve created it like you said here…
the content is just visible for a moment. what did i do wrong?
thx
tomJune 16, 2019 at 5:20 pm #1110817Hi hoibi1984,
Not sure what code you added, the page just reloads.
Could you please attach a mockup of what you’re trying to achieve?
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
Best regards,
VictoriaJune 17, 2019 at 9:22 am #1110955Hi Victoria,
of course you can have access.
I´ve tried display a color section just by clicking a button like it is explained ahead.
I´ve done all the things yigit wrote on top of this topic.
this is the url of the example: http://petra.ammersee-media.de/portfolio/
thx for your help!
June 19, 2019 at 5:45 pm #1111648yes, the page does just reload, because the button has no target. where has the button to point at?
June 22, 2019 at 6:48 am #1112514Hi,
Sorry for the late reply, I have taken a look at your page and found some errors in your functions.php code, I corrected it to reflect the code above. So I see that you have two “toggle” images and 3 buttons, I made the top two open & close toggle 1 and the bottom one open & close toggle 2
I was able to have two different buttons on one page by using this functions.php:function avia_custom_accs(){ ?> <script> jQuery(document).ready(function(){ jQuery('.accsb a').click(function() { jQuery('#accs').slideToggle('fast'); }); jQuery('.accsb1 a').click(function() { jQuery('#accs1').slideToggle('fast'); }); }); </script> <?php } add_action('wp_footer', 'avia_custom_accs');
I did this as an example for your page, if you don’t need this functionalty, then just remove:
jQuery('.accsb1 a').click(function() { jQuery('#accs1').slideToggle('fast'); });
from the code.
I also removed the css, as I don’t believe it’s necessary.
Please clear your browser cache and check.Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.