New answers tagged

0

There is some changes in code try this $query = new WP_Query(array( 'tag' => 'php' )); if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); the_content() ; endwhile; endif ;


1

It is not recommended to use query_posts. But this is not the problem, Problem is you are using PHP variable in single quotes. 'tag=$tag' Consider these examples: query_posts('tag=php'); //OR query_posts("tag=$tag"); //$tag should output: php Using WP_query //Recommended $query = new WP_Query(array( 'tag' => 'php' )); Ref: WP_Query-Tag_Parameters ...


1

Pass the array of arguments with key include. $tags = get_tags(array('include' => '10, 11, 34, 35'));


0

maybe a better/more simple approch is hooking in "wp_generate_tag_cloud_data" ;) function tribalpixel_tag_cloud_class($tags_data) { foreach ($tags_data as $key => $tag) { $tags_data[$key]['class'] = $tags_data[$key]['class'] ." myCustomClass"; } return $tags_data; } add_filter('wp_generate_tag_cloud_data', ' ...


2

You could set up a custom post type with custom taxonomies and then allow people to filter the results or do a search. Failing that, perhaps an event plugin would help. It depends on how much coding you want to do or if you want to try and find a plug and play solution.


0

the_terms() Both the_tags() and the_terms() uses get_the_term_list(), the different is that the_tags() has the default put in for post_tag. Watch them in wp-includes/category-template.php


0

You could modify your query on pre_get_posts. Example: // I'd wouldn't hardcode the tags/category ids, but where to store and // how to retrieve those settings go beyond the scope of this question. define( 'YIVIS_EXCLUDED_TAG', 12 ); add_action( 'pre_get_posts', 'yivi_excludes_tags' ); function yivi_excludes_tags( $query ) { if ( ...


2

Here is your updated function solving your 2 problems : // Post title as keywords, excluded stop words function title_as_keywords( $word ) { $blacklist = array('this', 'about', 'that', 'them'); // Excluded words ... $whitelist = array('one', 'man', 'boy'/*etc..*/); // Whitelisted words ... if ( (!in_array( $word, $blacklist ) && strlen( ...



Top 50 recent answers are included