質問

I'm developing a wordpress page and I'm looking for the best practices to send custom DB queries. I created a archive page with a list of artists. These names are stored in a custom post type's custom taxonomy. Now I want to code links on every name, which should lead the visitor to a page where all the posts that have this artists name in this custom field.

I know how to create the custom DB query, but how do I submit the name? Just over a normal POST-request? Is there a convenient way to do this within WP?

Thanks for your help. Dan

役に立ちましたか?

解決

you said in your question "custom post type's custom taxonomy"

you can create a custom taxonomy template to list all posts under a particular taxonomy. you can use this detailed tutorial how to use taxonomy.

http://code.tutsplus.com/tutorials/introducing-wordpress-3-custom-taxonomies--net-11658

他のヒント

I think the best way to do this would be store the artists name as a meta value attached to the post. Then you could use Wordpress inbuilt meta query to easily output all posts with the artists name stored as a meta value.

$meta_query_args = array(
    array(
        'key'     => 'artist',
        'value'   => 'John Doe',
        'compare' => '='
    )
);
$meta_query = new WP_Meta_Query( $meta_query_args );
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top