Snippet/shortcode moves on content page
-
I’ve created a working snippet/shortcode that accesses a table in my WordPress database to show content on a page. (Perhaps not the best use of snippets?)
function fl_aries_co_today_shortcode() { global $wpdb; $results = $wpdb->get_results("SELECT table FROM wplx_scope_co WHERE date = CURDATE() AND sign = 'ar'"); foreach($results as $r) { echo "<p>".$r->table."</p>"; } } add_shortcode( 'fl_aries_co_today','fl_aries_co_today_shortcode' );
The code executes and outputs the database result. However, it places the result at the top of my content area (and not in the text area where I paste the snippet).
Any idea how to get the database output from the snippet to stay where I placed it in body of my content? I’m using the built-in text editor that is part of the BeaverBuilder theme.
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Snippet/shortcode moves on content page’ is closed to new replies.