Remove author name from category page, latest posts etc

January 2013 WordPress Theme
GK User
Tue Mar 05, 2013 8:17 am
How can I remove author name from category page, latest posts etc
I only want it on post page and nowhere else.

Also, how can I get category link in the same line in which date, author name etc is mentioned, I want it on all pages.

FYI, I have removed the sidebar code. As I want all the information at the top.

Thanks.
User avatar
Senior Boarder

GK User
Tue Mar 05, 2013 9:32 am
Hi,

In this case you have to open file gavern/helpers.layout.fragments.php and edit function gk_post_meta fragments:

Code: Select all
<li>
   <?php _e('Written by:', GKTPLNAME); ?>
          
   <a class="url fn n" href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>" title="<?php echo esc_attr(sprintf(__('View all posts by %s', GKTPLNAME), get_the_author())); ?>" rel="author"><?php echo get_the_author(); ?></a>
</li>


to:

Code: Select all
<?php if(is_single()) : ?>
<li>
   <?php _e('Written by:', GKTPLNAME); ?>
          
   <a class="url fn n" href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>" title="<?php echo esc_attr(sprintf(__('View all posts by %s', GKTPLNAME), get_the_author())); ?>" rel="author"><?php echo get_the_author(); ?></a>
</li>
<?php endif; ?>


and add after this fragment this one:

Code: Select all
<?php if(!is_page()) : ?>
<li>
   <?php _e('Category:', GKTPLNAME); ?>
   <?php echo get_the_category_list( __(', ', GKTPLNAME )); ?>
</li>
<?php endif; ?>
User avatar
Administrator


cron