Home Forums Weaver X Tutorials and Hints tutorial to add and display custom post Re: tutorial to add and display custom post


Hi Scrambler,
I’ve created some shortcode to display a table of medicinal plants, I’ve included this shortcode as a plugin.
When I try to include the shortcode in a page, only the table header appears:

Here’s the shortcode for the above:

* Plugin Name: Medicinal Plant Table
* Description: Display all medicinal plants in a table
* Version: 1.0
* Author: David
* Author URI: sharethecure.org

function plant_table()  {
    $output .= ‘<style>th {text-align:center}</style>’;
    $output .= ‘<table border=”1″ bordercolor=”#DDDDDD” class=”table table-striped” style=”width:70%”>’;
    $output .= ‘<caption>Test Table</caption>’;
    $output .= ‘<thead><th>Medicinal Plant</th>’;
    $output .= ‘<th style=”text-align: left;”><div>Family<br/><div style=”margin-left: 20px”>Genus<br/></div><div style=”margin-left: 40px”>Species</div></div></th>’;
    $output .= ‘<th>Parts Used</th>’;
    $output .= ‘<th align=”center”>Medicinal Use</th>’;
    $output .= ‘<th>view/hide details</th>’;
    $output .= ‘</thead><tbody>’;

The function returns $output, but only the above appears on the page, all the table content that follows and is also added to $output is ignored, any idea why this should be happening? – The whole table appears correctly on my localhost using another theme

Thanks for any help