最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Embed iframe or html page into dashboard widget

programmeradmin8浏览0评论

I was wondering if it would be possible to embed an html page or add an iframe into a dashboard widget.

I have a multi author blog and i want to make my admin section a simple as possible for some of my author's are less "technical". So I already added a simple widget containing some text. And I took out the less interesting widgets. And I added some links so they can stay on their dashboard page but be able to do everything they had to do.

But I thought it would also be interesting to embed some sort of comment box so they could like talk to each other and discuss things. something like this

I gives you some html code wich you can paste into your webpage.

So I started to experiment but all the things I tried came out negative. I thought that if I would be able to simply embed it into a widget or embed it on a html page and view it trough an Iframe it could work. But like I said can't seem to pull it off.

Is it possible? or am I just wasting my time?

I was wondering if it would be possible to embed an html page or add an iframe into a dashboard widget.

I have a multi author blog and i want to make my admin section a simple as possible for some of my author's are less "technical". So I already added a simple widget containing some text. And I took out the less interesting widgets. And I added some links so they can stay on their dashboard page but be able to do everything they had to do.

But I thought it would also be interesting to embed some sort of comment box so they could like talk to each other and discuss things. something like this http://www.htmlcommentbox

I gives you some html code wich you can paste into your webpage.

So I started to experiment but all the things I tried came out negative. I thought that if I would be able to simply embed it into a widget or embed it on a html page and view it trough an Iframe it could work. But like I said can't seem to pull it off.

Is it possible? or am I just wasting my time?

Share Improve this question edited Jul 16, 2016 at 10:00 cjbj 15k16 gold badges42 silver badges89 bronze badges asked Jun 16, 2011 at 19:21 PenGuin__PenGuin__ 531 silver badge3 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 5

Sure, you can do this. It sounds like it would make more sense to add a protected forum to your installation though... but here's how you would do it:

// Create the function to output the contents of our Dashboard Widget
function iframe_dashboard_widget_function() {
    // Display whatever it is you want to show
    echo '<iframe src="http://www.htmlcommentbox" width="100%" height="300" frameBorder="0">Browser not compatible.</iframe>';
}

// Create the function use in the action hook
function example_add_dashboard_widgets() {
    wp_add_dashboard_widget('iframe_dashboard_widget', 'Iframe Dashboard Widget', 'iframe_dashboard_widget_function');
}

// Hook into the 'wp_dashboard_setup' action to register our other functions
add_action('wp_dashboard_setup', 'example_add_dashboard_widgets' );
发布评论

评论列表(0)

  1. 暂无评论