Show posts in Category with Tag (Wordpress)?

In the query_posts funciton, the tag parameter refers to the slug, not the name. Unfortunately, the query_posts function cannot accept the tag name; however, there is a wonderful WP function that can act as an intermediary for us. To get the tag information based on the name, you can use this.

In the query_posts funciton, the tag parameter refers to the slug, not the name. Unfortunately, the query_posts function cannot accept the tag name; however, there is a wonderful WP function that can act as an intermediary for us. To get the tag information based on the name, you can use this: $term = get_term_by('name', $name_of_tag, 'post_tag'); $term will be an object with the following information: term_id name slug term_group term_taxonomy_id taxonomy description parent count For instance, you can get the id with $term->term_id.

So putting this all together, you should be able to accomplish what you need with: $tag_name = wp_title('', FALSE); $term = get_term_by('name', $tag_name, 'post_tag'); query_posts( 'tag_id=' . $term->term_id); I've not tested what wp_title actually returns, so I don't know if this properly returns the title, but I'm trusting you on this ;) Sources: codex.wordpress.org/Function_Reference/W... codex.wordpress.org/Function_Reference/g....

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions