Formatting HTML

怎甘沉沦 提交于 2019-12-24 09:58:55

问题


I have been trying to get my tabs working by using the tabs shortcodes in PHP.

The first part of my question was to figure out how to write the PHP code and shortcodes in the PHP file. @jeremyharris helped me out with this here

ob_start();
get_template_part("includes/categories-panel");
$cats = ob_get_clean();
ob_start();
get_template_part('includes/home-map-panel');
$home = ob_get_clean();

echo do_shortcode('[tabs style="boxed"]
[tab title="First Tab"]' .$cats. '[/tab]
[tab title="Second Tab"]'. $home  .'[/tab]
[tab title="Third Tab"] Tab 3 Content here [/tab]
[tab title="Fourth Tab"] Tab 4 Content here [/tab]
[/tabs]');

The second question is now how to get the HTML working on the frontend. This could be a CSS or HTML conflict of some kind but the tabs are not working.

After inserting the code from the first question my HTML source looks like this http://pastie.org/4226310

I am not sure why the tabs are not showing correctly with the content. They are instead vertically aligned. I feel it might have something to do with the first include 'categories-panel' as when I remove that it works better...

I am working on localhost FYI.

Thanks for any help!

来源:https://stackoverflow.com/questions/11398482/formatting-html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!