WordPress.org

Ready to get started?Download WordPress

Forums

Author Spotlight (Widget)
[resolved] What if I don't want the authors box to show on pages? (4 posts)

  1. dealfonso
    Member
    Posted 1 year ago #

    I write in a blog in which there are at least 15 authors. For that reason we installed this (awesome) plugin and we're really pleased with it.
    Nevertheless, our blog has some pages in which we would prefer for an author not to appear (such as the "About us" or "Contact" pages).

    Is this possible?

    http://wordpress.org/extend/plugins/author-profile/

  2. Debashish
    Member
    Plugin Author

    Posted 1 year ago #

    Well an easy way out is to use a different sidebar for such pages. If you want to edit the plugin you may want to edit line 107 of the plugin code and the change the line

    from
    if(!$isHome && (is_single() || is_page()) && $authordata->ID){

    to something like:
    if(!$isHome && (is_single() || is_page()) && $authordata->ID && !is_page(array('About us','Contact'))){

    Ensure that you enter the correct page title in place of "About us" and "Contact". This will make the widget disappear on these pages, additional pages may be added separating page titles with "comma", as shown above.

    Note that the plugin doesn't support this feature by default and I have not tested the above code. Do let me know if its works for you.

  3. dealfonso
    Member
    Posted 1 year ago #

    Thanks for replying so quickly!

    We finally managed to do the same in a more "generic" way by deleting one piece of the code.

    from
    if(!$isHome && (is_single() || is_page()) && $authordata->ID){

    to:
    if(!$isHome && (is_single()) && $authordata->ID){

    so the box won't appear on pages, just on articles.

  4. Debashish
    Member
    Plugin Author

    Posted 1 year ago #

    Cool :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.