PHP中的重定向链接

时间:2017-06-17 08:48:54

标签: php wordpress

我有一个wordpress主题,允许我添加特定的信息和链接。我有一些代码来管理url的链接。目前链接在同一标签中打开,意味着用户离开我们的网站。我需要在新标签页中打开链接。不是PHP开发人员我不知道如何做到这一点需要一些帮助。这是代码:

<?php if ($launch) : ?>
            <div class="project-view">
                <strong><?php _e('Standard', 'themify'); ?></strong>
                <a href="<?php echo esc_url($launch); ?>"><?php _e('View Standard', 'themify'); ?></a>
            </div>
    <?php endif; ?>

由于

1 个答案:

答案 0 :(得分:-1)

<?php if ($launch) : ?>
        <div class="project-view">
            <strong><?php _e('Standard', 'themify'); ?></strong>
            <a href="<?php echo esc_url($launch); ?>" target="_blank"><?php _e('View Standard', 'themify'); ?></a>
        </div>
<?php endif; ?>