Dacă optați pentru ca pagina de confirm URL să fie pe propriul site, este important să includeți în aceea pagina informații despre comanda/înscrierea participantului.

Pentru aceasta trebuie să creați o pagina dedicată pentru Confirmare Înscriere. Pentru această pagina trebuie creat un template custom in tema activa. 

Acest template poate fi fie unul care sa il selectezi la editarea paginii sau sa il faci cu un nume gen page-132.php pentru a fi selectat automat dupa id-ul pagina. Detalii despre această procedură găsiți pe wordpress.org.

Template exemplu

Mai jos găsiți un exemplu de cod pentru un astfel de template.

<?php
/**
 * The template for displaying all pages.
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site will use a
 * different template.
 */
 
if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}
 
get_header(); ?>
 
    <div id="primary" <?php generate_content_class();?>>
        <main id="main" <?php generate_main_class(); ?>>
            <?php
            /**
             * generate_before_main_content hook.
             * @since 0.1
             */
            do_action( 'generate_before_main_content' );
 
            while ( have_posts() ) : the_post();
 
                get_template_part( 'content', 'page' );
 
                if ($_GET['hash'] && strlen($_GET['hash']) == 40) { ?>
                    <iframe src="https://register.42km.ro/widgets/orders/thank_you?hash=<?php echo $_GET['hash']; ?>" style="width:100%;height:1500px"></iframe>
                <?php } else { ?>
                    <h3>Invalid URL</h3>
                <?php } ?>
 
                // If comments are open or we have at least one comment, load up the comment template.
                <?php if ( comments_open() || '0' != get_comments_number() ) : ?>
 
                    <div class="comments-area">
                        <?php comments_template(); ?>
                    </div>
 
                <?php endif;
 
            endwhile;
 
            /**
             * generate_after_main_content hook.
             *
             * @since 0.1
             */
            do_action( 'generate_after_main_content' );
            ?>
        </main><!-- #main -->
    </div><!-- #primary -->
 
    <?php
    /**
     * generate_after_primary_content_area hook.
     * @since 2.0
     */
     do_action( 'generate_after_primary_content_area' );
 
     generate_construct_sidebars();
get_footer();

Comments

  1. Pingback: Stabilire URL custom pentru pagina confirmare inscriere – Register.42km.ro Organizers Help

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.