Tag Info

New answers tagged

0

First Question: Solved by copying and modifying the "archive-product.php" template file. if(is_product_tag(array('audio'))) : include 'archive-product-audio.php'; // includes custom loop else: // default archive loop endif; Second Question: Solved by simply filtering the Recent Products shortcode via "function.php". ...


1

You can build a stack of unique tags, then loop over them again to output. Couple of extra things though - never use query_posts. Secondly, you can be way more efficient in your querying and save a lot of memory in the process: $post_ids = get_posts( array( 'posts_per_page' => -1, 'category_name' => 'testing', 'fields' ...


1

As you have already pointed out in your question, custom taxonomies are the way to go here. For this taxonomy to behave like the build in taxonomy post_tag, you need to set the hierarchical parameter to false. To make these taxonomy available to only your two specific post types, you need to specifiy this when registering your taxonomy. Example ...


0

Found the problem. In my args, I should have included this line: 'post_type' => array( 'one', 'two', 'three', 'four', 'five', 'six' ), above the 'tag' arguments


1

Custom Field Tag filter: You can try the following code snippet to filter tags from a custom field: /** * Support the 'include_tags' custom field (comma seperated tag slugs) * to filter out those tags to display. * * @see http://wordpress.stackexchange.com/a/183929/26350 */ ! is_admin() && add_filter( 'get_the_terms', function( $terms, ...


2

By get_the_tags() you receive an array of tags attached to the current post. So you could do the following: $tags = get_the_tags(); $tag_ids_to_print = array( 1, 2, 3 ); //List of Tag IDs which you want to be printed $print_tags = array(); if( is_array( $tags ) ){ foreach( $tags as $tag ){ if( in_array( $tag->term_id, $tag_ids_to_print ) ) ...


2

This same exact question was asked earlier this week or over the weekend, and it had me thinking. Here is the idea that I came up with. If you look at the source code of the WP_Query class, you will see that sticky posts is only added to the first page of the home page. There is also no filter supplied to change this behavior in order to set the required ...


0

Another way that @toscho's solution made me try, and worked for me, is this scheme: http://example.com/videos/?tag=crazy


3

Take a look at custom variables for Google Analytics. In that case you would need to parse all used tags as one string (maybe separated by | for example), because it's better to use one variable name and each variable can take one value per pageview. Another option would be using events, using a category (named tags for example), which you could repeat for ...


0

If you have done the first part correctly in loop-home.php, you can just simply move that into the appropriate template used by your archive pages. Taken into account that you have not used custom queries to build your queries on the homepage or any of the archive pages, you can do the following which will work on any of the aforementioned pages Use the ...


0

get_the_tags codex page says The following example displays the tag name of each tag assigned to the post (this is like using the_tags(), but without linking each tag to the tag view, and using spaces instead of commas): <?php $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { echo $tag->name . ' '; } } ?> ...


0

This is the source of all your problems: <?php if(is_home() && !is_paged()) { ?> <?php query_posts(array('post__in'=>get_option('sticky_posts'))); ?> This takes the current query, and puts it to one side, and places a new query in its place. Here you're saying that you want to show the first page of sticky posts. You ...


0

If you use those custom fields only for the company tagged posts, then it's sufficient to retrieve the custom fields without worrying about posts and tags: $tags = array('Professional Rating', 'Efficiency Rating', 'Referral Rating'); foreach ($tags as $tag) { $result = $wpdb->get_col( "SELECT meta_value FROM wp_postmeta WHERE meta_key = '$tag'" ); ...



Top 50 recent answers are included