Как получить ссылку на содержимое вкладки? - PullRequest
0 голосов
/ 13 апреля 2020

У меня есть страница с двумя вкладками, и каждая вкладка может быть показана, если мы нажали на ссылку внутри страницы. Можно ли как-нибудь попасть на мою вкладку и показать ее содержимое?

Вот URL моего сайта https://www.behealthy.asia/cp/
Здесь находится первая вкладка https://www.behealthy.asia/cp/#regularuser
Вот вторая вкладка https://www.behealthy.asia/cp/#company
и это мой код.

<div class="<?php echo esc_attr($getClasses); ?>">
    <div class="tg-registerarea tg-haslayout">
        <?php if (!empty($atts['title']))
{ ?>
            <div class="tg-loginarea">
                <div class="tg-bordertitle">
                    <h3><?php echo esc_attr($atts['title']); ?></h3>
                </div>
            </div>
        <?php
} ?>
        <fieldset>
            <ul class="tg-tabnav" role="tablist">
                <li role="presentation" class="active">
                    <a href="#regularuser" data-toggle="tab">
                        <span class="lnr lnr-user"></span>
                        <div class="tg-navcontent">
                            <h3><?php esc_html_e('Regular Single User', 'listingo_core'); ?></h3>
                            <span><?php esc_html_e('Register As Service Seeker', 'listingo_core'); ?></span>
                        </div>
                    </a>
                </li>
                <li role="presentation">
                    <a href="#company" data-toggle="tab">
                        <span class="lnr lnr-briefcase"></span>
                        <div class="tg-navcontent">
                            <h3><?php esc_html_e('Company / Professional', 'listingo_core'); ?></h3>
                            <span><?php esc_html_e('Register As Service Provider', 'listingo_core'); ?></span>
                        </div>
                    </a>
                </li>
            </ul>   
            <div class="tg-themetabcontent tab-content">
                <div class="tab-pane active fade in" id="regularuser">
                    <form action="#" method="post" class="seeker-register do-registration-form">
                        <div class="form-group">
                            <div class="tg-registeras">
                                <span><?php esc_html_e('Already have an account? Please login', 'listingo_core'); ?></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <input type="text" name="register[username]" class="form-control" placeholder="<?php esc_html_e('User Name, eg alex', 'listingo_core'); ?>">
                        </div>
                        <?php if (apply_filters('listingo_dev_manage_fields', 'true', 'user_nicename') === 'true')
{ ?>
                            <div class="form-group">
                                <input type="text" name="register[user_nicename]" class="form-control" placeholder="<?php esc_html_e('Nicename eg : alex', 'listingo_core'); ?>">
                                <?php do_action('listingo_get_tooltip', 'element', 'nicename'); ?>
                            </div>
                        <?php
} ?>
                        <?php if (apply_filters('listingo_dev_manage_fields', 'true', 'first_name') === 'true')
{ ?>
                            <div class="form-group">
                                <input type="text" name="register[first_name]" class="form-control" placeholder="<?php esc_html_e('First Name', 'listingo_core'); ?>">
                            </div>
                        <?php
} ?>
                        <?php if (apply_filters('listingo_dev_manage_fields', 'true', 'last_name') === 'true')
{ ?>
                            <div class="form-group">
                                <input type="text" name="register[last_name]" class="form-control" placeholder="<?php esc_html_e('Last Name', 'listingo_core'); ?>">
                            </div>
                        <?php
} ?>
                        <?php if (apply_filters('listingo_dev_manage_fields', 'true', 'gender') === 'true')
{ ?>
                            <div class="form-group">
                                <span class="tg-select">
                                    <select name="register[gender]">
                                        <option value=""><?php esc_html_e('Gender', 'listingo_core'); ?></option>
                                        <option value="male"><?php esc_html_e('Male', 'listingo_core'); ?></option>
                                        <option value="female"><?php esc_html_e('Female', 'listingo_core'); ?></option>
                                    </select>
                                </span>
                            </div>
                        <?php
} ?>
                        <?php if (apply_filters('listingo_dev_manage_fields', 'true', 'phone') === 'true')
{ ?>
                            <div class="form-group">
                                <input type="text" name="register[phone]" class="form-control" placeholder="<?php esc_html_e('Phone', 'listingo_core'); ?>">
                                <?php do_action('listingo_get_tooltip', 'element', 'phone'); ?>
                            </div>
                        <?php
} ?>
                        <div class="form-group">
                            <input type="email" name="register[email]" class="form-control" placeholder="<?php esc_html_e('Email', 'listingo_core'); ?>">
                        </div>
                        <div class="form-group">
                            <input type="password" name="register[password]" class="form-control" placeholder="<?php esc_html_e('Password', 'listingo_core'); ?>">
                        </div>
                        <div class="form-group">
                            <input type="password" name="register[confirm_password]" class="form-control" placeholder="<?php esc_html_e('Retype Password', 'listingo_core'); ?>">
                        </div>
                        <?php do_action('listingo_registration_customer_extra_fields'); ?> 
                        <div class="form-group term-group">
                            <?php
if (isset($captcha_settings) && $captcha_settings === 'enable')
{
?>
                                <div class="domain-captcha">
                                    <div id="recaptcha_signup"></div>
                                </div>
                            <?php
} ?>
                            <div class="tg-checkbox">
                                <input name="terms"  type="hidden" value="0"  />
                                <input name="terms" type="checkbox" id="terms">
                                <label for="terms">
                                    <?php if (!empty($terms_link))
{ ?>
                                        <?php esc_html_e('I have read the', 'listingo_core'); ?>&nbsp;<a target="_blank" href="<?php echo esc_url($terms_link); ?>"><?php esc_html_e('Terms & Conditions', 'listingo_core'); ?></a>&nbsp;<?php esc_html_e('and accept them', 'listingo_core'); ?>
                                    <?php
}
else
{ ?>
                                        <?php

    echo "ฉันยอมรับในเงื่อนไขและข้อกำหนดทุกประการ";
?>

                                    <?php
} ?>
                                    <a href="https://www.behealthy.asia/%e0%b9%80%e0%b8%87%e0%b8%b7%e0%b9%88%e0%b8%ad%e0%b8%99%e0%b9%84%e0%b8%82%e0%b9%81%e0%b8%a5%e0%b8%b0%e0%b8%82%e0%b9%89%e0%b8%ad%e0%b8%81%e0%b8%b3%e0%b8%ab%e0%b8%99%e0%b8%94/" target="_blank">คลิกเพื่ออ่านเงื่อนไขและข้อกำหนด</a>

                                </label>

                                <input type="hidden" name="register[account]" value="seeker">
                                <?php wp_nonce_field('register_seeker_request', 'register_seeker_request'); ?>
                                <button class="tg-btn do-regiter-me" type="submit"><?php esc_html_e('Register Now', 'listingo_core'); ?></button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="tab-pane fade in" id="company">
                    <form action="#" method="post" class="do-registration-form">
                        <div class="form-group">
                            <div class="tg-registeras">
                                <span><?php esc_html_e('Register As', 'listingo_core'); ?>:</span>
                                <div class="tg-radio">
                                    <input type="radio" class="register_type" value="business" id="business" name="register[type]" checked>
                                    <label for="business"><?php esc_html_e('Business', 'listingo_core'); ?></label>
                                </div>
                                <div class="tg-radio">
                                    <input type="radio" class="register_type" value="professional" id="professional" name="register[type]">
                                    <label for="professional"><?php esc_html_e('professional', 'listingo_core'); ?></label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <span class="tg-select">
                                <select name="register[category]" class="sp-category">
                                    <option value=""><?php esc_html_e('Select Category', 'listingo_core'); ?></option>
                                    <?php listingo_get_categories('', 'sp_categories'); ?>
                                </select>
                            </span>
                        </div>

Обратите внимание, что есть две вкладки, #regularuser и # company

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...