Php 链接到另一页上的引导模式

Php 链接到另一页上的引导模式,php,wordpress,Php,Wordpress,我有一个网站,每个人的简历都会弹出一个模式,在template-team.php上的代码设置如下 <div class="tem_pic" id ="<?php echo $p->ID ?>" data-toggle="modal" data-target="#leader-modal-<?php echo $p->ID; ?>" 这可以通过PHP和JS的结合来实现。假设您的template team.php被分配给https://example.co

我有一个网站,每个人的简历都会弹出一个模式,在template-team.php上的代码设置如下

<div class="tem_pic" id ="<?php echo $p->ID ?>" data-toggle="modal" data-target="#leader-modal-<?php echo $p->ID; ?>"

这可以通过PHP和JS的结合来实现。假设您的
template team.php
被分配给
https://example.com/team
。现在,为了弹出一个团队的bio模式,我们创建了类似
https://example.com/team?m=Junaid
(m代表会员)

使用下面的代码,我们可以根据页面加载时的URL参数弹出一个模式

<?php if ( isset($_GET['m']) ) : ?>
<?php // I'll skip how to open a specific modal, I think you're separating those with team member ID or whatever ?>
    <script>
        jQuery('window').on('load', function(){
            // to open a modal in JS
            jQuery('#target-modal-ID').modal('show');
        });
    </script>
<?php endif; ?>

jQuery('window')。在('load',function()上{
//在JS中打开模态
jQuery('#目标模式ID').modal('show');
});

加载JS后,将此代码放入
template team.php
。根据您的需求定制和修改代码。

这可以通过PHP和JS的结合来实现。假设您的
template team.php
被分配给
https://example.com/team
。现在,为了弹出一个团队的bio模式,我们创建了类似
https://example.com/team?m=Junaid
(m代表会员)

使用下面的代码,我们可以根据页面加载时的URL参数弹出一个模式

<?php if ( isset($_GET['m']) ) : ?>
<?php // I'll skip how to open a specific modal, I think you're separating those with team member ID or whatever ?>
    <script>
        jQuery('window').on('load', function(){
            // to open a modal in JS
            jQuery('#target-modal-ID').modal('show');
        });
    </script>
<?php endif; ?>

jQuery('window')。在('load',function()上{
//在JS中打开模态
jQuery('#目标模式ID').modal('show');
});
加载JS后,将此代码放入
template team.php
。根据您的需求自定义和修改代码