Display custom fields from custom posts in RSS feed

$price = $wpdb->get_row($wpdb->prepare(“SELECT salePrice FROM ‘ . $wpdb->gm_ads_products . ‘ WHERE post_id = ‘ . $post->ID . ‘”)); // this seems to be the issue Yes, that’s right. First, because $wpdb->prepare() requires at least two parameters, one is the SQL query with placeholders like %d (for numbers) and the other is the replacement values that … Read more

Return XML of Post Metadata

The best solution is to create a custom XML page template in the exact format you need. If you look at the code below taken from the WordPress XML exporter you can see that the data it returns contains the normal stuff we see in a typical WordPress loop. echo ‘<?xml version=”1.0″ encoding=”‘ . get_bloginfo(‘charset’) … Read more

How do I order my loop query?

The Problem $my_posts doesn’t contain any posts. It contains post IDs and likes. And you’re dropping both into post__in, which can’t work. I guess even the number of posts wouldn’t work if the plugin(?) wouldn’t add any post with a 0-x integer to the db-table per default. The Debug Try the following: $my_likes = $wpdb->get_col(“SELECT … Read more

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