WordPress Default Search cannot show data in Ninja Table
-
Dear Sir,
We searched about this topic on your forum and found a previous answer.
We followed your suggestions to add some codes to the functions.php and rebuilt the index in the Relevanssi plugin. However, the wordpress default search box can only recognize the data in the first column of the Ninja Table. When I search for the data of the other columns, the wordpress default search box does not show.Please kindly advise how to amend the following code:
/*relevanssi*/ add_filter( 'relevanssi_post_content', 'relevanssi_index_ninja_cached_table_html' ); function relevanssi_index_ninja_cached_table_html( $content ) { $m = preg_match_all( '/.*\[ninja_tables.*?id=["\'](\d+)["\'].*?\]/im', $content, $matches, PREG_PATTERN_ORDER ); if ( ! $m ) { return $content; } foreach ( $matches[1] as $table_id ) { $cached_table_html = get_post_meta( $table_id, '__ninja_cached_table_html', true ); $content .= ' ' . $cached_table_html; } return $content; }
Thanks & regards,
KFThe page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘WordPress Default Search cannot show data in Ninja Table’ is closed to new replies.