• I’ll be very happy if someone help me to can correct this code:

    if ($category != all) { $cats = "AND '$wpdb->link2cat'.category_id = $category"; }
    
    		$results = $wpdb->get_results("
    			SELECT DISTINCT link_url, link_name, link_image, link_description, link_rss
    			FROM '$wpdb->links'
    			LEFT JOIN '$wpdb->link2cat' ON ('$wpdb->links'.link_id = '$wpdb->link2cat'.link_id)
    			WHERE link_visible = 'Y' $cats
    			ORDER BY '$wpdb->links'.link_$order
    			$sort $limit");

    thankss

Viewing 1 replies (of 1 total)
  • Thread Starter Marcomail

    (@marcomail)

    Ok, i’ve solved, this is the correct code if someone it’s interested to merge link to the correct category:

    if ($category != all) { $cats = "AND'$wpdb->term_relationships'.term_taxonomy_id = $category"; }
    
    		$results = $wpdb->get_results("
    			SELECT DISTINCT link_url, link_name, link_image, link_description, link_rss
    			FROM '$wpdb->links'
    			LEFT JOIN '$wpdb->term_relationships' ON ('$wpdb->links'.link_id = '$wpdb->term_relationships'.object_id)
    			WHERE link_visible = 'Y' $cats
    			ORDER BY '$wpdb->links'.link_$order
    			$sort $limit");
Viewing 1 replies (of 1 total)

The topic ‘Someone can correct this code for running with wp 2.7 ?’ is closed to new replies.