• Hello,
    I am pretty new to php and I am not able to solve this for my blog.
    I would like to display content in the sidebar depending on the post author.

    For example if the post author is XXXX I would like to display banner YYY in the sidebar.

    I know how to display banners and how to write an IF statement but I am wondering about the pos_author- should I use “the_author” or “get_the_author”.

    Could somebody help me?

Viewing 1 replies (of 1 total)
  • Keep in mind both “the_author” and “get_the_author” need to be used within the loop so depending on how you are displaying your banners this might be tricky. With that said you’d want to use “get_the_author” because it will allow you to pass it to a php variable then write the appropriate if statement.

    If you post your code in pastebin it may be more useful for anyone trying to help.

Viewing 1 replies (of 1 total)
  • The topic ‘Display elements depending on post author’ is closed to new replies.