Okay
  Public Ticket #1180022
Suscribe Form
Closed

Comments

  • AMoulias started the conversation

    Hello ! Thanks for the theme, it's amazing work guys ! :)

    I have 2 questions please : 

    1) How can I customize the suscribe mailchimp form ? 

    2) Can I link the pop-up "Suscribe" to a button wich i created in a lambda page ? How can I do that ? 

    Thanks guys ! 

    Have a good day ! 

  •  124
    8 Guild replied

    #subscribe-pageHi,

    Thank you for your appreciation!

    1) How can I customize the suscribe mailchimp form ? 

    I suppose we are talking about the popup subscribe form? You can customize form via the child theme https://codex.wordpress.org/Child_Themes. Install and activate a child theme. You can find it in the full package (All files and Documentation option on the TF). After that you have to edit functions.php file within your child theme. Add this code snippet at the most bottom of the file:

    /**
     * Subscribe form modal dialog
     *
     * @since 1.0.0
     */
    function appica_subscribe_modal_form() {
        $action = appica_option_get( 'socials_mailchimp' );
        if ( empty( $action ) ) {
            return;
        }
        $label = appica_option_get( 'socials_subscribe_label', esc_html__( 'Subscribe', 'appica' ) );
        // MailChimp prepare Anti-Spam
        $request_uri = parse_url( htmlspecialchars_decode( $action ), PHP_URL_QUERY );
        parse_str( $request_uri , $c );
        $mc_antispam = sprintf( 'b_%1$s_%2$s', $c['u'], $c['id'] );
        unset( $request_uri, $c );
        ?>
        <div class="modal fade" id="subscribe-page">
            <div class="modal-dialog">
                <div class="container">
                    <div class="modal-form">
                        <form method="post" action="<?php echo esc_url( $action ); ?>" id="subscribe-form" autocomplete="off" target="_blank">
                            <h3 class="modal-title space-bottom-2x"><?php echo esc_html( $label ); ?></h3>
                            <div class="form-group">
                                <label for="si-name" class="sr-only"><?php esc_html__( 'Name', 'appica' ); ?--></label>
                                <input type="text" class="form-control" name="NAME" id="si-name" placeholder="Name" required="">
                                <span class="error-label"></span>
                                <span class="valid-label"></span>
                            </div>
                            <div class="form-group space-top-2x">
                                <label for="si_email" class="sr-only"><!--?php esc_html__( 'Email', 'appica' ); ?--></label>
                                <input type="email" class="form-control" name="EMAIL" id="si_email" placeholder="Email" required="">
                                <span class="error-label"></span>
                                <span class="valid-label"></span>
                            </div>
                            <div style="position: absolute; left: -5000px;">
                                <input type="text" name="<?php echo esc_attr( $mc_antispam ); ?>" tabindex="-1" value="">
                            </div>
                            <div class="space-top-2x clearfix">
                                <button type="button" class="btn-round btn-ghost btn-danger pull-left" data-dismiss="modal"><i class="flaticon-cross37"></i></button>
                                <button type="submit" class="btn-round btn-ghost btn-success pull-right"><i class="flaticon-correct7"></i></button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <?php
    }
    

    2) Can I link the pop-up "Suscribe" to a button wich i created in a lambda page ? 

    Yes, you can. But you have to add two required params to this link. See example below:

    <a href="#" data-toggle="modal" data-target="#subscribe-page">Subscribe</a>

    data-toggle="modal" and data-target are required. Please note, #subscribe-page is ID of the modal form (see first function). So, if you change the ID, you also have to change the data-target.

    Regards,

    8Guild Team

  • AMoulias replied

    Hello ! 

    Thank for answering :)

    It is not working actually. 

    That is the php default code of the functions.php file of my child theme : 

    <?php
    // Exit if accessed directly
    if ( !defined( 'ABSPATH' ) ) exit; // BEGIN ENQUEUE PARENT ACTION
    // AUTO GENERATED - Do not modify or remove comment markers above or below: // END ENQUEUE PARENT ACTION

    If I copy the code you gave at the most bottom of the file me i see a white screen and i need to return to the old code :(

  •  124
    8 Guild replied

    Hi,

    Please provide your FTP and WordPress credentials. I need to check myself.

    Regards,

    8Guild Team