WordPress.org

Support

Support » Plugins and Hacks » Yoast SEO » [Plugin: WordPress SEO by Yoast] Tag/Category Broken in Page Titles

[Plugin: WordPress SEO by Yoast] Tag/Category Broken in Page Titles

Viewing 15 replies - 1 through 15 (of 65 total)
  • Same problem 🙁

    Version 1.2.8.6, is not displaying the name of the author on the title page. Appears “%% name%%” instead of the name.

    Guess I’m not the only one – hope this bug is fixed soon!

    Same problem :/

    Same problem (I suppose) for events category

    http://www.marcatrevigiana.it/eventi/categoria/mostre

    Same problem 😕 🙁

    Same here.

    I guess open wpseo-functions.php in inc folder and find: (line 158)

    '%%pagenumber%%' => $pagenum,

    Add below:

    '%%category%%' => wpseo_get_terms( $r->ID, 'category' ),

    uggur, thanks, but it doesn’t work for me.

    Julian,

    Maybe you should find : (About these lines 153 to 186)

    $replacements = array(
    ‘%%date%%’ => $date,
    ‘%%searchphrase%%’ => esc_html( get_query_var( ‘s’ ) ),
    ‘%%page%%’ => ( $max_num_pages > 1 && $pagenum > 1 ) ? sprintf( $sep . ‘ ‘ . __( ‘Page %d of %d’, ‘wordpress-seo’ ), $pagenum, $max_num_pages ) : ”,
    ‘%%pagetotal%%’ => $max_num_pages,
    ‘%%pagenumber%%’ => $pagenum,
    ‘%%category%%’ => wpseo_get_terms( $r->ID, ‘category’ ),
    );

    if ( isset( $r->post_type ) ) {
    $replacements = array_merge( $replacements, array(
    ‘%%caption%%’ => $r->post_excerpt,

    ‘%%category%%’ => wpseo_get_terms( $r->ID, ‘category’ ),
    ‘%%excerpt%%’ => ( !empty( $r->post_excerpt ) ) ? strip_tags( $r->post_excerpt ) : utf8_encode( substr( strip_shortcodes( strip_tags( utf8_decode( $r->post_content ) ) ), 0, 155 ) ),
    ‘%%excerpt_only%%’ => strip_tags( $r->post_excerpt ),
    ‘%%focuskw%%’ => wpseo_get_value( ‘focuskw’, $r->ID ),
    ‘%%id%%’ => $r->ID,
    ‘%%modified%%’ => mysql2date( get_option( ‘date_format’ ), $r->post_modified ),
    ‘%%name%%’ => get_the_author_meta( ‘display_name’, !empty( $r->post_author ) ? $r->post_author : get_query_var( ‘author’ ) ),
    ‘%%tag%%’ => wpseo_get_terms( $r->ID, ‘post_tag’ ),
    ‘%%title%%’ => stripslashes( $r->post_title ),
    ‘%%userid%%’ => !empty( $r->post_author ) ? $r->post_author : get_query_var( ‘author’ ),
    ) );
    }

    if ( !empty( $r->taxonomy ) ) {
    $replacements = array_merge( $replacements, array(
    ‘%%category_description%%’ => trim( strip_tags( get_term_field( ‘description’, $r->term_id, $r->taxonomy ) ) ),
    ‘%%tag_description%%’ => trim( strip_tags( get_term_field( ‘description’, $r->term_id, $r->taxonomy ) ) ),
    ‘%%term_description%%’ => trim( strip_tags( get_term_field( ‘description’, $r->term_id, $r->taxonomy ) ) ),
    ‘%%term_title%%’ => $r->name,
    ) );
    }

    And replace with this:

    $replacements = array(
    ‘%%date%%’ => $date,
    ‘%%title%%’ => stripslashes( $r->post_title ),
    ‘%%excerpt%%’ => ( !empty( $r->post_excerpt ) ) ? strip_tags( $r->post_excerpt ) : substr( strip_shortcodes( strip_tags( $r->post_content ) ), 0, 155 ),
    ‘%%excerpt_only%%’ => strip_tags( $r->post_excerpt ),
    ‘%%category%%’ => wpseo_get_terms( $r->ID, ‘category’ ),
    ‘%%category_description%%’ => !empty( $r->taxonomy ) ? trim( strip_tags( get_term_field( ‘description’, $r->term_id, $r->taxonomy ) ) ) : ”,
    ‘%%tag_description%%’ => !empty( $r->taxonomy ) ? trim( strip_tags( get_term_field( ‘description’, $r->term_id, $r->taxonomy ) ) ) : ”,
    ‘%%term_description%%’ => !empty( $r->taxonomy ) ? trim( strip_tags( get_term_field( ‘description’, $r->term_id, $r->taxonomy ) ) ) : ”,
    ‘%%term_title%%’ => $r->name,
    ‘%%focuskw%%’ => wpseo_get_value( ‘focuskw’, $r->ID ),
    ‘%%tag%%’ => wpseo_get_terms( $r->ID, ‘post_tag’ ),
    ‘%%modified%%’ => mysql2date( get_option( ‘date_format’ ), $r->post_modified ),
    ‘%%id%%’ => $r->ID,
    ‘%%name%%’ => get_the_author_meta( ‘display_name’, !empty( $r->post_author ) ? $r->post_author : get_query_var( ‘author’ ) ),
    ‘%%userid%%’ => !empty( $r->post_author ) ? $r->post_author : get_query_var( ‘author’ ),
    ‘%%searchphrase%%’ => esc_html( get_query_var( ‘s’ ) ),
    ‘%%page%%’ => ( $max_num_pages > 1 && $pagenum > 1 ) ? sprintf( $sep . ‘ ‘ . __( ‘Page %d of %d’, ‘wordpress-seo’ ), $pagenum, $max_num_pages ) : ”,
    ‘%%pagetotal%%’ => $max_num_pages,
    ‘%%pagenumber%%’ => $pagenum,
    ‘%%caption%%’ => $r->post_excerpt,
    );

    @ugger

    I also had to copy from line 173:
    '%%tag%%' => wpseo_get_terms( $r->ID, 'post_tag' ),

    and paste it under:
    '%%category%%' => wpseo_get_terms( $r->ID, 'category' ),

    It should be fix it?

    @ugger

    Yes, I had to add the tag line to fix the tags error.

    @uggur

    With Events calendar does not work!
    Can you help me?

    Where can I download the previous version of the plugin?

Viewing 15 replies - 1 through 15 (of 65 total)
  • The topic ‘[Plugin: WordPress SEO by Yoast] Tag/Category Broken in Page Titles’ is closed to new replies.
Skip to toolbar