-
AuthorPosts
-
November 30, 2023 at 5:48 pm #1426832
Hello everyone
I have on the homepage link 01 belowand made a password protected page
is it possible to insert a slider on this page above and on this page link 02 below:and also under pASsword input and send
to enter a text.thanks
kind regards FranzDecember 1, 2023 at 10:39 am #1426875Hey schweg33,
Thank you for the inquiry.
Are you trying to edit the password protected page? If so, try to add this filter in the functions.php file and add your own modifications.
function avf_custom_password_form() { global $post; $label = 'pwbox-' . ( empty( $post->ID ) ? rand() : $post->ID ); $output = ' <div class="boldgrid-section"> <div class="container"> <div class="av-more-info">More info here</div> <form action="' . esc_url( site_url( 'wp-login.php?action=postpass', 'login_post' ) ) . '" class="form-inline post-password-form" method="post"> <p>' . __( 'This content is password protected. This is a custom message. To view it please enter your password below:' ) . '</p> <label for="' . $label . '">' . __( 'Password:' ) . ' <input name="post_password" id="' . $label . '" type="password" size="20" class="form-control" /></label><button type="submit" name="Submit" class="button-primary">' . esc_attr_x( 'Enter', 'post password form' ) . '</button> </form> </div> </div>'; return $output; } add_filter('the_password_form', 'avf_custom_password_form', 99);
If you want to add a slider, try setting the builder to debug mode so that you can extract the shortcode of a builder element from one of your pages.
// https://kriesi.at/documentation/enfold/intro-to-layout-builder/#debug-mode
Best regards,
IsmaelDecember 1, 2023 at 10:06 pm #1426922Thank you very much
Ismael
thanks to you I managed to do the textunfortunately I can’t manage with the slider.
Thank you
and greetings
FranzDecember 3, 2023 at 6:18 pm #1427056Hi,
Thank you for your patience, I tried to add your slider to the top of your page with a function at the bottom of your functions.php but it caused an error and the theme editor would not let me remove the code. Please include FTP access to your site so I can correct and try again with some new code.
I had tested my code on my demo site first and it worked but it caused an error on your site, so I must of made an error, sorry.Best regards,
MikeDecember 3, 2023 at 8:39 pm #1427073Thanks Mike
Attached the login dataDecember 3, 2023 at 9:09 pm #1427074Hi,
Thank you, I corrected the code to show your Slider Revolution slider from the page that you linked to by injecting the slider shortcode[rev_slider alias="dorfgeschichte-doppel"][/rev_slider]
above the password field on the password protected page.
I added this code your your child theme functions.phpadd_action( 'ava_after_main_container', 'ava_after_main_container_mod', 10 ); function ava_after_main_container_mod() { if ( is_page(2959) ) { echo do_shortcode('[rev_slider alias="dorfgeschichte-doppel"][/rev_slider]'); } }
Please check
Best regards,
MikeDecember 3, 2023 at 9:49 pm #1427076Hello Mike super
many thanks
Works really greatOnly afterwards on the opened page
do I see the slider 2 times?
December 3, 2023 at 9:57 pm #1427077Hi,
Try removing the slider element in the page and leave the code in the functions.phpBest regards,
MikeDecember 3, 2023 at 10:02 pm #1427078Sorry Mike
it all fits
have looked againthe slider on the page must then be deleted.
you can close this request
thanks
kind regards FranzDecember 3, 2023 at 10:29 pm #1427080Hello Mike
now me again
if I also want to insert the second page
an error occurs
below the code
greetings Franz
many thanksThere was a critical error on your website.
December 3, 2023 at 10:36 pm #1427081Fehler-Details
==============
Ein Fehler vom Typ E_COMPILE_ERROR wurde in der Zeile 75 der Datei /home/httpd/vhosts/dorfgeschichte.li/httpdocs/wp-content/themes/enfold-child/functions.php verursacht. Fehlermeldung: Cannot redeclare ava_after_main_container_mod() (previously declared in /home/httpd/vhosts/dorfgeschichte.li/httpdocs/wp-content/themes/enfold-child/functions.php:66)December 3, 2023 at 11:23 pm #1427082Hi,
This is because you can not use the same name for the function twice, so for two different slides on two different pages try this code in your child theme functions.phpadd_action( 'ava_after_main_container', 'rev_slider_one', 10 ); function rev_slider_one() { if ( is_page(15240) ) { echo do_shortcode('[rev_slider alias="bereich-vorstand"][/rev_slider]'); } } add_action( 'ava_after_main_container', 'rev_slider_two', 10 ); function rev_slider_two() { if ( is_page(2959) ) { echo do_shortcode('[rev_slider alias="bereich-mitglieder"][/rev_slider]'); } }
Note that I changed ava_after_main_container_mod in 2 places for each snippet to
rev_slider_one
rev_slider_two
So if you want to copy this for a third slider on a third page you could name it
rev_slider_three
Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.Best regards,
MikeDecember 4, 2023 at 9:28 am #1427107thanks mike
so it fits great
with 2 different functionsI still tried to make titles colored here
that does not work
see belowthanks
kind regards
FranzDecember 4, 2023 at 9:51 am #1427109if both sliders are determined by their alias – you can try that with one function too. Both i guess will work:
add_action( 'ava_after_main_container', 'rev_slider_mod', 10 ); function rev_slider_mod() { if ( is_page(15240) ) { echo do_shortcode('[rev_slider alias="bereich-vorstand"][/rev_slider]'); } if ( is_page(2959) ) { echo do_shortcode('[rev_slider alias="bereich-mitglieder"][/rev_slider]'); } }
for color try in quick css:
#top .rs-parallax-wrap .rs-layer { color: yellow !important; }
December 4, 2023 at 10:23 am #1427115Thank you Guenni007
for your feedback
everything is working finewith the color i don’t mean the color in the slider
sondern die farbe in der meldung aus der function.php
<div class=”av-more-info”><span style=”font-size: 14pt; color: ##0097d2;”>Dorfgeschichte Eschnen Nendeln</span></div>
December 4, 2023 at 11:29 am #1427122Hi,
Your color has two hashtags, try removing one of them
change: color: ##0097d2;
to: color: #0097d2;Best regards,
MikeDecember 4, 2023 at 12:16 pm #1427126Thank you Mike and Guienna 07
It all fits perfectly nowAlways great support!
You can close this request
kind regards
Francis -
AuthorPosts
- The topic ‘slider above the password entry?’ is closed to new replies.