davidesalerno
Forum Replies Created
-
Forum: Plugins
In reply to: Customizable Post Listings – not able to limit category listingI’ve got a problem in modifyng the plugin with your instructions. In fact using your code I’ve got this error from MySQL:
” Unknown column ‘wp_term_relationships.term_taxonomy_id’ in ‘on clause’] ”
because you put the 2 LEFT JOIN in a bad order.
The LEFT JOIN correct syntax isSELECT fields FROM first_table LEFT JOIN second_table ON first_table.primary_key = second_table_external_keyAnd so the correct LINE 59 is:
if ($categories) {
$sql .= "LEFT JOIN $tableterm_relationships ON ($tableposts.ID = $tableterm_relationships.object_id) LEFT JOIN $tableterm_taxonomy ON ($tableterm_relationships.term_taxonomy_id = $tableterm_taxonomy.term_taxonomy_id)";
$cats = explode(' ', $categories);
}Everything works correctly with this line for me.
Forum: Plugins
In reply to: List of recent posts (Plugin: Customizable Post Listings)I’ve got a problem in modifyng the plugin with the instructions given by Adam on Lorelle’s blog on WordPress.com
” Unknown column ‘wp_term_relationships.term_taxonomy_id’ in ‘on clause’] ”
because the 2 LEFT JOIN in a bad order.
The LEFT JOIN correct syntax isSELECT fields FROM first_table LEFT JOIN second_table ON first_table.primary_key = second_table_external_keyAnd so the correct LINE 59 is:
if ($categories) {
$sql .= "LEFT JOIN $tableterm_relationships ON ($tableposts.ID = $tableterm_relationships.object_id) LEFT JOIN $tableterm_taxonomy ON ($tableterm_relationships.term_taxonomy_id = $tableterm_taxonomy.term_taxonomy_id)";
$cats = explode(' ', $categories);
}Everything works correctly with this line for me.