【问题标题】:Using nextgen variable in header.php file在 header.php 文件中使用 nextgen 变量
【发布时间】:2012-02-22 03:15:47
【问题描述】:

在 Wordpress 网站中,我得到了 nextgen 画廊插件的变量 - $gallery。

它拥有我需要的一切。我认为它在 wp-content/plugins/nextgen 文件夹 nggfunctions.php 文件中。

我需要在我的 wp-content/themes/twentyten/header.php 文件中使用这个变量。

我该怎么做?

【问题讨论】:

    标签: php variables gallery call nextgen-gallery


    【解决方案1】:

    丑陋的解决方案是使用 global 语句将其提升到您当前的范围。 更多信息请查看:http://nl2.php.net/manual/en/language.variables.scope.php

    【讨论】:

    • 试图写 $GLOBALS['gallery'];或全球 $gallery; var_dump($gallery);仍然为空
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-22
    • 2014-06-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多