I am trying to edit the post meta data on my Wordpress blog to include:
Author(no link) Date(no link) Page(with affiliate link to page on my site)
under every Post Title.
I am using the Activello theme and have installed a child theme. I am trying to create a function to do this post meta data.
This is what is there right now (this posts the author and date with a link):
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;
I have tried to work on this and something is still not right with my code as I am getting an error. PLEASE HELP!
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;
If someone could please help, I would really appreciate it!