author meta tag in header (4 posts)

  1. Puanthanh Gangmei
    Posted 6 years ago #

    The code below doesn't work with the header.php but it show in other place eg. the sidebar.
    <?php the_author_meta('headerads'); ?>

    Can anyone tell me the reason why and show me the way. I am starting a collaborative blog. I will to show user specified ads in the header from their profile page.

  2. esmi
    Forum Moderator
    Posted 6 years ago #

    You need to specify a user id outside of the Loop.


  3. Puanthanh Gangmei
    Posted 6 years ago #

    Dear esmi
    specifying a user id for each users will be a tiresome jobs to do. It means I have to create custom headers for each users. Suppose if I have 1000s users!!!??

    I think WordPress is missing on this.

  4. Michael
    Forum Moderator
    Posted 6 years ago #

    'there are no problems unless you create them youself'

    assuming that this only makes sense on single post display,
    you could simply make a loop if there is no - try and use this where you had your line:

    <?php if(is_single()) :
    while ( have_posts() ) : the_post(); 
    endwhile; wp_reset_query();
    endif;   ?>

Topic Closed

This topic has been closed to new replies.

About this Topic