WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#4506 closed defect (bug) (fixed)

"Posts Tagged xxx" In Archives In Default Theme Doesn't Show Tag Name

Reported by: Viper007Bond Owned by: pishmishy
Milestone: 2.3 Priority: high
Severity: normal Version: 2.3
Component: Template Keywords: has-patch
Focuses: Cc:

Description

Click a tag under a post. The tag is missing from the title.

Posts Tagged ‘’

Simply put, single_cat_title() isn't outputting the tag name.

Attachments (4)

general-template.php.patch (501 bytes) - added by pishmishy 9 years ago.
Adds single_tag_title function
archive.php.patch (867 bytes) - added by pishmishy 9 years ago.
uses new function in default theme
taxonomy.php.patch (439 bytes) - added by pishmishy 9 years ago.
general-template.php.diff (914 bytes) - added by gdevlugt 9 years ago.

Download all attachments as: .zip

Change History (11)

#1 follow-ups: @pishmishy
9 years ago

I think the problem is that single_cat_title() is meant to output the tag name.

#2 in reply to: ↑ 1 @pishmishy
9 years ago

Replying to pishmishy:

I think the problem is that single_cat_title() is meant to output the tag name.

Sorry that really wasn't clear. What I meant is that single_cat_title() isn't meant to output the tag name and there probably should be an equivalent single_cat_title().

@pishmishy
9 years ago

Adds single_tag_title function

@pishmishy
9 years ago

uses new function in default theme

#3 @pishmishy
9 years ago

  • Keywords has-patch added; needs-patch removed

I ran into problems writing the single_tag_title() function. I'm not entirely sure what purpose

$value = sanitize_title($field);

served in taxonomy.php and it appeared to me to break that particular function when searching based on a slug.

#4 @pishmishy
9 years ago

  • Owner changed from anonymous to pishmishy
  • Status changed from new to assigned

#5 @gdevlugt
9 years ago

I added a patch for the single_cat_title() function in wp-includes/general-template.php.

I haven't tested it fully but it seems to work.

#6 in reply to: ↑ 1 @Viper007Bond
9 years ago

Replying to pishmishy:

I think the problem is that single_cat_title() is meant to output the tag name.

Hmm, guess it'd help if I noticed that 'cat' != 'tag', huh? D'oh.

#7 @ryan
9 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [6074]) Set tag_id to first tag in multi tag queries. Have single_cat_title() fallback to single_tag_title() if is_tag so that existing category templates will work with tags. fixes #4506

Note: See TracTickets for help on using tickets.