New Landing How can we help? Themeforest Theme Support Flexform Author in breadcrumb incorrectly defaults to user id 1

Viewing 3 posts - 1 through 3 (of 3 total)
  • Posted in: Flexform
  • #12494
    catmatch
    Member
    Post count: 5

    The author being listed for every archive page within the breadcrumb is the same (user id #1). I believe this is an issue with FlexForm and not with the Breadcrumb NavXT plugin because if I deactivate FlexForm and use the standard TwentyTwelve Theme, the authors all show correctly.

    For example, when viewing http://www.mysite.com/blog/author/wshakespeare/

    The breadcrumb shows:
    My Site > Articles by: John Doe

    Any help would be greatly appreciated.

    Thanks.

    #13003
    catmatch
    Member
    Post count: 5

    Hello Support, any insight into this?

    #13016
    catmatch
    Member
    Post count: 5

    Ok I dug into the code myself and I found the problem:

    First on line 83 of /flexform/archive.php the $author variable is being set with an object.


    <?php $author = get_userdata( get_query_var('author') ); ?>

    Then on lines 378-380 of /breadcrumb_navxt/breadcrumb_navxt_class.php the global reference to $author is being accessed. $author should be int, however it is now an object set from the archive page in flexform, thus the return value will always be 1 (user_id #1).


    global $author;
    //Get the Author name, note it is an object
    $curauth = (isset($_GET['author_name'])) ? get_userdatabylogin($author_name) : get_userdata(intval($author));

    I have disabled all plugins and changed my theme to TwentyTwelve and the $author variable is global and is correctly set to the author ID. I am not sure who’s bug this is (flexform, wp, or breadcrumb-navxt) because according to the WP codex, $author is not listed as a global (only $authordata). However breadcrumb-navxt is obviously expecting a global $author.

    Hope this helps.

    ~Jason

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register