/>PHP – functions.php
function simple_table( $atts ) {
extract( shortcode_atts( array(
‘cols’ => ‘none’,
‘data’ => ‘none’,
), $atts ) );
$cols = explode(‘,’,$cols);
$data = explode(‘,’,$data);
$total = count($cols);
$output = ‘
| {$col} |
| {$datum} |
‘;
return $output;
}
add_shortcode( ‘table’, ‘simple_table’ );
SHORTCODE
[table cols="names,values" data="name1,25,name2,409"]
/>
/>
/> Visit wpsnipp.com for details on how to setup this WordPress snippet.
/>
/> Share this post. Facebook | StumbleUpon | Delicious | Tweet It | Digg This | DesignBump-It | DesignPoke-it
/>
/>






















0 Comments
You can be the first one to leave a comment.