ThemeShaper Forums » Thematic

[closed]

thematic_tag_query broken

(10 posts)
  • Started 13 years ago by oldmankit
  • Latest reply from newb
  • This topic is not resolved
  1. Hello,

    Whilst doing final tests for my new site, I found that on tag archive pages the title is "Tag Archives:" followed by blank. It does not display the title of the tag. Here is an example: http://blog.peaceandtruth.com/tag/travel/

    I found the relevant section in my functions.php file. I haven't done anything to this particular section, as you can see. Why does $content .= __(thematic_tag_query()); give me nothing?

    (Archives by date are working: http://blog.peaceandtruth.com/2011/03/)

    // Filter the page title
    // located in archive.php, attachement.php, author.php, category.php, search.php, tag.php
    	function childtheme_override_page_title() {
    
    		global $post;
    
    		$content = '';
    		if (is_attachment()) {
    				$content .= '<h2 class="page-title"><a href="';
    				$content .= apply_filters('the_permalink',get_permalink($post->post_parent));
    				$content .= '" rev="attachment"><span class="meta-nav">&laquo; </span>';
    				$content .= get_the_title($post->post_parent);
    				$content .= '</a></h2>';
    		} elseif (is_author()) {
    				$content .= '<h1 class="page-title author">';
    				$author = get_the_author_meta( 'display_name' );
    				$content .= __('Author Archives: ', 'thematic');
    				$content .= '<span>';
    				$content .= $author;
    				$content .= '</span></h1>';
    		} elseif (is_category()) {
    				$content .= '<h1 class="page-title">thought stream:';
    				$content .= ' <span class="thought-stream">';
    				$content .= single_cat_title('', FALSE);
    				$content .= '</span></h1>' . "\n";
    				$content .= '<div class="post"><div class="archive-meta">';
    				if ( !(''== category_description()) ) : $content .= apply_filters('archive_meta', category_description()); endif;
    				$content .= '</div></div>';
    		} elseif (is_search()) {
    				$content .= '<h1 class="page-title">';
    				$content .= __('Search Results for:', 'thematic');
    				$content .= ' <span id="search-terms">';
    				$content .= esc_html(stripslashes($_GET['s']));
    				$content .= '</span></h1>';
    		} elseif (is_tag()) {
    				$content .= '<h1 class="page-title">';
    				$content .= __('Tag Archives:', 'thematic');
    				$content .= ' <span>';
    				$content .= __(thematic_tag_query());
    				$content .= '</span></h1>';
    		} elseif (is_tax()) {
    			    global $taxonomy;
    				$content .= '<h1 class="page-title">';
    				$tax = get_taxonomy($taxonomy);
    				$content .= $tax->labels->name . ' ';
    				$content .= __('Archives:', 'thematic');
    				$content .= ' <span>';
    				$content .= thematic_get_term_name();
    				$content .= '</span></h1>';
    		}	elseif (is_day()) {
    				$content .= '<h1 class="page-title">';
    				$content .= sprintf(__('Daily Archives: <span>%s</span>', 'thematic'), get_the_time(get_option('date_format')));
    				$content .= '</h1>';
    		} elseif (is_month()) {
    				$content .= '<h1 class="page-title">';
    				$content .= sprintf(__('Monthly Archives: <span>%s</span>', 'thematic'), get_the_time('F Y'));
    				$content .= '</h1>';
    		} elseif (is_year()) {
    				$content .= '<h1 class="page-title">';
    				$content .= sprintf(__('Yearly Archives: <span>%s</span>', 'thematic'), get_the_time('Y'));
    				$content .= '</h1>';
    		} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
    				$content .= '<h1 class="page-title">';
    				$content .= __('Blog Archives', 'thematic');
    				$content .= '</h1>';
    		}
    		$content .= "\n";
    		echo apply_filters('childtheme_override_page_title', $content);
    	}
    Posted 13 years ago #
  2. stumped. does it work if you aren't overriding the function?

    what happens if you change

    echo apply_filters('childtheme_override_page_title', $content);

    to

    echo apply_filters('thematic_page_title', $content);

    also- i really like your design, btw. it is very clean and cool!

    Posted 13 years ago #
  3. Strange. I tried what you suggested. I also tried deleting the whole functions.php file, and it still doesn't display. I'm not sure what else to try.

    Thanks for your compliment!

    Posted 13 years ago #
  4. I just did some testing. I reverted to the default thematic theme, and the same problem remains. There is no problem with twenty ten.

    Am I the only one having this problem with thematic?

    Posted 13 years ago #
  5. middlesister
    Member

    I have had the same problem as you.

    Actually, it seemed to me like ´thematic_tag_query()´ was not returning anything. I ended up *cough* editing one of the core files.

    In ´thematic_tag_query()´ (which is in helpers.php) I added

    $orig_tag_query = get_query_var('tag');

    right at the beginning of the function and simply changed the return statement to

    return $orig_tag_query;

    which works for me so far. In your case, since you are overriding the page title anyway, I guess just replacing the call to ´thematic_tag_query()´ with ´get_query_var('tag')´ would do the trick?

    I don't know how it used to be before, but with wordpress 3.1 and thematic 0.9.8 this seems to be broken. Is there a place to report bugs with thematic?

    Posted 13 years ago #
  6. report bugs here:
    http://code.google.com/p/thematic/issues/list

    Posted 13 years ago #
  7. middlesister
    Member

    Thanks, bug report written.

    I love working with thematic and reading the forums have helped me get my head around how it works. Recently I have started to realize that I actually know some things that can help others too. I would love to start giving back to the community!

    Now I am no expert programmer, but I can read and understand code fairly well. I have used thematic for two client sites using custom made child themes, one bilingual. The flexibility of the framework is fantastic! I would like to contribute to the project in any way I can. Maybe help with the swedish translation if needed. The dream would be to actually write a patch or an enhancement.

    But, like I said, I am no expert and just starting to get my feet wet in the open source community. Bug reporting is still something though, and something I can do right now. And participating in the forums of course. Baby steps, right? :-)

    Posted 13 years ago #
  8. newb
    Member

    Hello,

    I'm using middlesister's method. What do i need to edit to recieve tag name(right now it gets slug) after "Tag Archives:"?

    Posted 12 years ago #
  9. middlesister
    Member

    Actually, the method I used above was a quick fix hack and not a real solution. I think I have found a better (real?) solution to the problem. If you are editing that function, do not use what I wrote above but instead make sure the end of the foreach loop looks like this:

    // concatenate display name and prettified operators
    	if ( isset( $tag_ops[$tag_ops_counter] ) ) {
    		$nice_tag_query = $nice_tag_query.$tag->name.$tag_ops[$tag_ops_counter];
    		$tag_ops_counter += 1;
    	} else {
    		$nice_tag_query = $nice_tag_query.$tag->name;
    		$tag_ops_counter += 1;
    	}

    Basically, I added the else block to take care of that last tag. Hmm, now how do I generate a patch for that bug I reported....

    Posted 12 years ago #
  10. newb
    Member

    Works. Thanks a lot!

    Posted 12 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.