[Plugin: WP-Table Reloaded] include category variable in Template Tag Funcion
-
Thank you so much for this work–I have had no problem getting everything to work as it should as well as adding in the necessary Extensions. The Documentation and FAQs have been of great help and this plugin is beyond excellent—proving to be better and better the more I dig into it.
I am, though, trying something that is pushing me outside my PHP/WP skill set and hope that this is a simple answer from those with more talent.
Scenario: I have a list of product numbers that correspond to a category tag. SJ1301, SJ1301A, SJ1301B, SJ1302, etc., etc. I have this bit of code currently which populates bits of text and pulls images based on that category
$model_number_terms = wp_get_object_terms($post->ID, 'model_number'); if(!empty($model_number_terms)){ if(!is_wp_error( $model_number_terms )){ foreach($model_number_terms as $term){ echo ' <img src="folder/'.$term->name.'.png" alt="'.$term->name.'" / > '; } } }
(in this case ‘.term->name.’ returns SJ1301 )
This works great and I have quite a bit of information building out on the pages with little effort on the data entry side–have it running some shortcodes, building links to documents, bunches of things for these pages…
Where I am getting stuck is that I have a Specifications table which lists ALL of my products and I would like to filter this table based on the category/product name.
When manually entered into the template this works perfectly:
wp_table_reloaded_print_table( "id=4&use_tablesorter=true&print_name=false&filter=SJ1301||SJ1301A||SJ1301B" );
What I would like is something that works similarly to how the images are pulling and builds the filter based on the Category:
(again, using the example of ‘.term->name.’ returning SJ1301)wp_table_reloaded_print_table( "id=4&use_tablesorter=true&print_name=false&filter=$term->name" );
and, eventually, so that I could try to play the wild card for the product variations
wp_table_reloaded_print_table( "id=4&use_tablesorter=true&print_name=false&filter=$term->name||$term->nameA||$term->nameB" );
(displaying the rows for SJ1301, SJ1301A, SJ1301B)
Again…my skills are not so great and I have been running in circles trying to accomplish this and, I am sure, looking for solutions in ways that just aren’t correct. I am just not sure how to make this work…
Thanks to anyone who has any advice!
- The topic ‘[Plugin: WP-Table Reloaded] include category variable in Template Tag Funcion’ is closed to new replies.