Breaking shortcode?
-
I have a small addon:
function beer_search(){ global $wp_query; $this_post_id = $wp_query->post->ID; if(get_post_meta($this_post_id, 'beer_search', true) == 'true') { // echo "IS THIS THING ON"; $wptest_maindb = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST); $beer_search_connection = $wptest_maindb->get_results("SELECT * FROM wp_inventory"); foreach ($beer_search_connection as $container) { echo "Name " . $container->inventory_name; } //$thestuff = $wpdb->get_results("SELECT * FROM wp_inventory"); //foreach ($thestuff as $container) { // echo $container->inventory_name . ', '; // echo $container->inventory_description . '<br />'; } } //add_action('loop_start', 'beer_search'); //add_action('the_content', 'beer_search'); add_filter('the_content', 'beer_search');
This addon breaks shortcode for some reason. Any suggestions?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Breaking shortcode?’ is closed to new replies.