• Hello!
    Did I do the right thing by adding the store name through the plugin Yoast Seo, adding a variable, maybe there is already a ready-made variable for insertion?

    function  get_name () {
    	$post_id = get_queried_object_id();
    	$post_author_id = get_post_field( 'post_author', $post_id );
    	$authordata = get_userdata( $post_author_id );
        $author = $authordata->user_nicename;
        return $author;
    }
    
    function  register_custom_yoast_variables () {
        wpseo_register_var_replacement ( '%%namestore%%' , 'get_name' , 'advanced' , 'Название магазина' );
    }
  • The topic ‘yoast seo variables – store name’ is closed to new replies.