function add_listing( $atts)
{ extract( shortcode_atts( array (
\'sslug\' => \'\',
\'jslug\' => \'\'
), $atts ) );
global $wpdb;
$qstr = \'
SELECT *
FROM $wpdb->posts
LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID = $wpdb->term_relationships.object_id)
LEFT JOIN $wpdb->term_taxonomy ON($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
LEFT JOIN $wpdb->terms ON($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id)
WHERE $wpdb->posts.post_type = "states"
AND $wpdb->posts.post_status = "publish"
AND $wpdb->term_taxonomy.taxonomy = "usstates"
AND $wpdb->term_taxonomy.taxonomy = "job-desc"
AND $wpdb->terms.slug = $sslug; <-----
OR $wpdb->terms.slug = $jslug; <--------
ORDER BY $wpdb->posts.post_date DESC
\';
add_shortcode("list", "add_listing");
我想替换值,例如:
这是我的示例短代码
[list sslug="alabama" jslug="electrician"]
我想将该值替换为上面的箭头
但无法使其发挥作用:(
请帮帮伙计们