Hi,
thanks for your post, and sorry for the trouble.
From what I can see, you will simply have to change those function names to something unique and the Shortcode as well, e.g.
add_action( 'genesis_before_post', 'marianne_genesis_tablepress_shortcode' );
function marianne_genesis_tablepress_shortcode() {
if ( is_category() ) {
echo do_shortcode( '[table id=123 /]' );
}
}
Regards,
Tobias
Thanks for your quick reply.
Wouldn’t have thought the solution could be that simple.
Except it doesn’t work (insert sad face).
The short code is still not working on my category page. It just show the actual short code text [table id=1 /]
Guess you have no insights on Genesis?
Hi,
no, sorry, I’m not familiar at all with Genesis.
It’s strange that this would not work on a category page though, I don’t really see why…
Maybe using the TablePress template tag functions work, e.g.
add_action( 'genesis_before_post', 'marianne_genesis_tablepress_shortcode' );
function marianne_genesis_tablepress_shortcode() {
if ( is_category() ) {
tablepress_print_table( array(
'id' => '123',
) );
}
}
Regards,
Tobias
Thank for trying.
But this doesn’t work either.
I have asked for support on the genesis forum too. Maybe someone there will have an idea.
For my understanding in your code what does the 123 stand for? Is that an actual number? Like would this render only a table with id-123 or does it render a table with any id?
Hi,
that 123 is an example for a table ID. You’d have to change this number to the ID of the table that you want to display.
I don’t know why the tables are still not showing though, sorry 🙁 Are they working fine in regular posts/pages on your site?
Regards,
Tobias