Formatting HTML

2019-08-01 13:03发布

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!

0条回答
登录 后发表回答