Hi,
I have found the “fictive_posted_on” function and in it there is a get_the_author() one.
Can I remove the author name only from the home page?
– George
Can I remove the author name only from the home page?
If you are comfortable with a bit of PHP you could probably add a condition to display the author only if the page is not the homepage.
something like:
if ( ! is_home() ) {
// do author stuff
}
More about the is_home conditional:
http://codex.ww.wp.xz.cn/Conditional_Tags#The_Main_Page
Thank you,
This function is useful. I am comfortable with a bit of php..
I want to remove the whole “author vcard” div. I am now in the function called “fictive_posted_on”. I added the is_home, but I still get this div that contains the icon on the home page, without the name. How can I remove them both?
My current code:
if ( is_home() )
{
printf( __( '<span class="post-date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a></span><span class="byline"><span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'fictive' ),
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_url( '' ),
esc_attr( '' ),
''
);
}
else
{
printf( __( '<span class="post-date"><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a></span><span class="byline"><span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'fictive' ),
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'fictive' ), get_the_author() ) ),
get_the_author()
);
}
OK! I found it. Thanks 🙂
Now I will try to move the author to the end of the article.. If I need I help I will post here. Thanks again!
Great! Please feel free to post your final code here – it’s always appreciated, as others in the community may come across this thread in the future, trying to do the very same thing as you. 🙂