duanang58939 2014-01-19 15:58
浏览 27
已采纳

在wordpress仪表板上编辑主题字符串变量

I have a website where weather parameters are very important. they are showing on every page and administrator should easy update them daily.

So it would be nice to have those four string variables on dashboard and then edit and save them.

Ss there a plugin way to add some string in dashboard and then output them in theme? or should i start learning how to write my first plugin?

Thanks for help.

[edit] we have some plugins which can do that but the question is now:

how to show admin plugin page as a widget on dashboard?

  • 写回答

1条回答 默认 最新

  • doudu2404 2014-01-19 20:36
    关注

    so the solution is based on two plugins and some copy-paste action.

    1. install: Just Variables plugin from http://wordpress.org/plugins/just-wp-variables/
    2. make some variables on admin > settings > just variables
    3. install Widget Builder from http://wordpress.org/plugins/widget-builder/
    4. make new widget and copy-paste form from yourdomain.com/wp-admin/themes.php?page=jv_theme_vars
    5. select "Available As Dashboard Widget", Save, and go to dashboard.

    you can change value of inputs to variables output and this should go like this:

    <form action="options.php" method="post">
        <input type="hidden" value="jv_theme_vars" name="option_page"/><input type="hidden" value="update" name="action"/><input type="hidden" value="ded28ad4c4" name="_wpnonce" id="_wpnonce"/><input type="hidden" value="/wp-admin/themes.php?page=jv_theme_vars" name="_wp_http_referer"/>
        <table class="form-table">
            <tr valign="top">
                <th scope="row">Your Variable</th>
                <td><input type="text" style="width: 15em" name="jv_values[your_variable]" value="[justvar code="your_variable"]" class="regular-text"/></td>
            </tr>
        </table>
        <p class="submit"><input type="submit" value="Save" class="button button-primary" id="submit" name="submit"/></p>       
    </form>
    

    good luck. :)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 求帮我调试一下freefem代码
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图