php - Wordpress- A plugin that displays HTML content (Database) with a shortcode -


i run project has database in google sheets. need display information in interactive tables.

i used sheetrock.js , handlebar.js (i wrote code , works want to). have wordpress website , want make plugin type shortcode , table coded appears on page.

i have separate html file embedded styling (under <style></style> tags, no external css file). file has html boiler plate, , in <head></head> there links sheetrock.js, handlebar.js, , bootstrap.

as far understand, php can't display html tags? tried doing following...

<?php function showico() { ?> <!doctype html> <head> <!-- cdn links  --> </head> <style> <!-- styling here, , know, it's not dry --> </style> <body> <!-- content want display (it has <script> tags, , variables) --> </body> </html> <?php return showico(); } add_shortcode ('add_ico','showico'); ?> 

perhaps doing wrong shortcode doesn't display content @ all. need make work?

you're returning function, cause recursion.

try:

<?php function showico() {     ob_start(); ?> <!doctype html> <head>  cdn links </head> <style> styling here, , know, it's not dry </style> <body> content want display (it has <script> tags, , variables) </body> </html><?php     return ob_get_clean(); } add_shortcode ('add_ico','showico'); ?> 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -