Wordpress integration
Wordpress integration
Hi!
I really love what DataTables can do and would love to integrate it with my wordpress site... I have tried everything but I just can't seem to get it working... here is the code that produces the table I'd like to 'dress-up':
[code]
<?php if ( !empty($caption) ) : ?>
<?php echo $caption; ?>
<?php endif; ?>
<?php if ( $options['list-headers'] ) : ?>
<?php foreach ( $show_fields as $field ) : ?>
<?php echo $listFields[$field]; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php foreach ( $gigs as $gkey => $g ) : ?>
<?php foreach ( $g->performances as $key => $p ) : ?>
<?php
if ( $key == 0 ) {
$fields = array(
'city' => '{' . $g->cityState . '}',
'country' => '{' . $g->country . '}',
'venue' => '{' . $g->name . '}',
'eventName' => '{' . $g->eventName . '}',
'date' => '{' . $g->date . '}',
'time' => '{' . $p->time . '}',
'shortNotes' => '{' . $p->shortNotes . '}',
'tickets' => ( $upcoming ? '' . ( !empty($p->link) ? '' : '') . '' : '' ),
'map' => '' . ($g->mapLink ? '' : '') . '',
);
} else {
$fields = array(
'city' => '',
'country' => '',
'venue' => '',
'eventName' => '',
'date' => '',
'time' => '{' . $p->time . '}',
'shortNotes' => '{' . $p->shortNotes . '}',
'tickets' => ( $upcoming ? '' . ( !empty($p->link) ? '' : '') . '' : '' ),
'map' => '',
);
}
echo dtcGigs::selectFields($fields, $g);
?>
<?php endforeach; ?>
<?php endforeach; ?>
<?php if ( empty($gigs) && $upcoming ) : ?>
<?php echo $options['no-upcoming']; ?>
<?php elseif ( empty($gigs) ) : ?>
<?php echo $options['no-past']; ?>
<?php endif; ?>
[/code]
Now, what method would you suggest me to use? I have tried the basic stuff but it doesn work i.e. I cant manage to get the sorting or search options swow up on the page...
tnx in advance
m.
I really love what DataTables can do and would love to integrate it with my wordpress site... I have tried everything but I just can't seem to get it working... here is the code that produces the table I'd like to 'dress-up':
[code]
<?php if ( !empty($caption) ) : ?>
<?php echo $caption; ?>
<?php endif; ?>
<?php if ( $options['list-headers'] ) : ?>
<?php foreach ( $show_fields as $field ) : ?>
<?php echo $listFields[$field]; ?>
<?php endforeach; ?>
<?php endif; ?>
<?php foreach ( $gigs as $gkey => $g ) : ?>
<?php foreach ( $g->performances as $key => $p ) : ?>
<?php
if ( $key == 0 ) {
$fields = array(
'city' => '{' . $g->cityState . '}',
'country' => '{' . $g->country . '}',
'venue' => '{' . $g->name . '}',
'eventName' => '{' . $g->eventName . '}',
'date' => '{' . $g->date . '}',
'time' => '{' . $p->time . '}',
'shortNotes' => '{' . $p->shortNotes . '}',
'tickets' => ( $upcoming ? '' . ( !empty($p->link) ? '' : '') . '' : '' ),
'map' => '' . ($g->mapLink ? '' : '') . '',
);
} else {
$fields = array(
'city' => '',
'country' => '',
'venue' => '',
'eventName' => '',
'date' => '',
'time' => '{' . $p->time . '}',
'shortNotes' => '{' . $p->shortNotes . '}',
'tickets' => ( $upcoming ? '' . ( !empty($p->link) ? '' : '') . '' : '' ),
'map' => '',
);
}
echo dtcGigs::selectFields($fields, $g);
?>
<?php endforeach; ?>
<?php endforeach; ?>
<?php if ( empty($gigs) && $upcoming ) : ?>
<?php echo $options['no-upcoming']; ?>
<?php elseif ( empty($gigs) ) : ?>
<?php echo $options['no-past']; ?>
<?php endif; ?>
[/code]
Now, what method would you suggest me to use? I have tried the basic stuff but it doesn work i.e. I cant manage to get the sorting or search options swow up on the page...
tnx in advance
m.
This discussion has been closed.
Replies
Allan
That was the first thing I've done - but with no results
n.
Allan
> TypeError: Result of expression '$' [undefined] is not a function.
which doesn't look good - no jQuery. Actually it looks like you are trying to include jQuery twice, which is a bit odd as well. I'd try to see if you can address that.
Allan