WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Replace variables (1 post)

  1. codestrong
    Member
    Posted 2 years ago #

    I did not find a mention anywhere of what var templates are available for titles, descriptions, etc. So, I made a list myself. Next to the template you will see the PHP logic being used to replace it with a value.

    %%sep%%
    %%sitename%%
    %%sitedesc%%
    %%currenttime%%
    %%currentdate%%
    %%currentmonth%%
    %%currentyear%%

    %%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,

    http://wordpress.org/extend/plugins/wordpress-seo/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.