我正在尝试编辑我的Wordpress博客上的帖子元数据,包括:

Author(no link) Date(no link) Page(with affiliate link to page on my site)

在每个职衔下 .

我正在使用Activello主题并安装了一个子主题 . 我正在尝试创建一个函数来发布元数据 .

这就是现在的情况(这会在作者和日期上发布一个链接):

if ( ! function_exists( 'activello_posted_on' ) ) :
  function activello_posted_on() {
    printf( '<div class="post-meta"><a href="%1$s">%2$s</a> <a href="%3$s">%4$s</a></div>',
      esc_url( get_permalink() ),
      esc_html( get_the_date() ),
      esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
      get_the_author()
    );
  }
endif;

我试图解决这个问题,因为我收到错误,我的代码仍然不对 . 请帮忙!

if ( ! function_exists( 'activello_posted_on' ) ) :
      function activello_posted_on() {
        printf( __(‘%1$s by %2$s <a href=“%3$s”>%4$s</a>’),
          get_the_date(), 
          get_the_author(),
          esc_url( get_permalink() ),
          esc_html( '<a href="http://www.diyandkawa.com/legalities/“>This post contains affiliate links.</a>' );

    );
  }
endif;

如果有人可以请求帮助,我真的很感激!