Custom plugin shows outside widget div
-
Hi,
I’ve written a basic plugin that queries the WP database to look for gig dates and displys them in a list with a date graphic that gets selected on the fly.
Its a simple query that I use on other websites, this is my first go at incorporating it into a WP plugin, the query seems to work fine – i’ve created a shortcode so that I can show the results in a widget box – but when I do this, the result is displayed above the widget area div instead of inside it.
I’ve been messing around with formatting for a while and I cant figure out why this might be happening. I’d be very grateful if anyone has any ideas.The plugin..
<?php /* Plugin Name: Dazza's Gig Bible Plugin URI: ..........etc, etc */ add_shortcode("gig_bible", "gig_bible_list"); function gig_bible_list() { include ('giglist.php'); } ?>
the query (giglist.php)…
<?php // Connects to your Database mysql_connect("host", "user", "password") or die(mysql_error()); mysql_select_db("db") or die(mysql_error()); $query = " SELECT day(show_date) as day, (left(LCASE(monthname(show_date)),3))as month, venue_name, venue_city, venue_postal_code, artist_name, artist_url FROM wp_gigpress_shows, wp_gigpress_artists, wp_gigpress_venues where show_venue_id = venue_id and show_artist_id = artist_id and show_date > curdate() order by show_date DESC LIMIT 1,1 "; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {echo "<img height=\"50px\" width=\"50px\" valign=\"bottom\" alt=\"calendarpic\" style=\"position:absolute; vertical-align:bottom; z-index:1;\" src=\"wp-content/plugins/Gig_bible/calpics/background.png\" margin=\"0px auto\" vspace=\"6\" align=\"left\"\"/> <img height=\"50px\" width=\"50px\" valign=\"top\" alt=\"calendarpic1\" style=\"position:absolute; z-index:2;\" src=\"wp-content/plugins/Gig_bible/calpics/{$row['day']}.png\" hspace=\"6\" vspace=\"20\" align=\"left\"\"/> <img height=\"50px\" width=\"50px\" valign=\"top\" alt=\"calendarpic2\" style=\"position:absolute; z-index:3;\" src=\"wp-content/plugins/Gig_bible/calpics/{$row['month']}.png\" hspace=\"6\" vspace=\"20\" align=\"left\"\"/>"; //"<span style=\"padding-left:55px;\">{$row['venue_name']}, {$row['venue_city']}</span>". "<p align=\"left\"><span style=\"padding-left:55px;\"></span></p>". "<p><br><a onclick=\"href='http://maps.google.co.uk/maps?f=q&source=s_q&hl=en&geocode=&q={$row['venue_postal_code']}'\" target=\"_blank\"><b><u>Click for map</b></u></a></p>"; } ?>
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Custom plugin shows outside widget div’ is closed to new replies.