Prepare WPDB with meta key and meta value

If you run this query manually, you should get a response like (1054, “Unknown column ‘wp_postmeta.meta_key’ in ‘where clause’”) Long story short, wp_postmeta.meta_key is not a valid column of wp_posts. You need to JOIN the postmeta table to be able to use its columns. (There are many resources out there that explain JOIN, one would … Read more

Using id to show item

If the GPX file is attached to the current page you can find it with get_attached_media(), e.g. $gpx_files = get_attached_media( ‘application/gpx+xml’ ); if ( count( $gpx_files ) >= 1 ) { echo do_shortcode (‘[sgpx gpx=”‘ . wp_get_attachment_url( $gpx_files[0]->ID ) . ‘”]’); } else { echo ‘<p class=”warning”>No GPX file attached!</p>’; }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)