WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 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 8 years ago.
Adds single_tag_title function
archive.php.patch (867 bytes) - added by pishmishy 8 years ago.
uses new function in default theme
taxonomy.php.patch (439 bytes) - added by pishmishy 8 years ago.
general-template.php.diff (914 bytes) - added by gdevlugt 8 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 follow-ups: @pishmishy8 years ago

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

comment:2 in reply to: ↑ 1 @pishmishy8 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().

@pishmishy8 years ago

Adds single_tag_title function

@pishmishy8 years ago

uses new function in default theme

@pishmishy8 years ago

comment:3 @pishmishy8 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.

comment:4 @pishmishy8 years ago

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

comment:5 @gdevlugt8 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.

comment:6 in reply to: ↑ 1 @Viper007Bond8 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.

comment:7 @ryan8 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.