WordPress.org

Ready to get started?Download WordPress

Forums

Really simple Facebook Twitter share buttons
Manually Placing In Theme Causing Error (5 posts)

  1. degmsb
    Member
    Posted 1 year ago #

    When I use the code in the FAQ's and place in my header section.

    <?php echo really_simple_share_publish(get_bloginfo('url'), get_bloginfo('name'));?>

    I get this error when wp debug is turned on.

    Notice: Trying to get property of non-object in /home3/ans/public_html/wp-includes/post-template.php on line 29

    Any idea how to resolve this issue?

    http://wordpress.org/extend/plugins/really-simple-facebook-twitter-share-buttons/

  2. whiletrue
    Member
    Plugin Author

    Posted 1 year ago #

    Hi degmsb,
    the issue should disappear upgrading to the 2.9.1 plugin release, out today.

  3. degmsb
    Member
    Posted 1 year ago #

    Hi thank you for the update. I am still seeing the issue on my site with the 2.91, but it is not happening on all pages. If I don't use the manual code in my theme I get no notices. But when I add the manual code, I get it on the my custom page for a taxonomy. I have two loops on the page, and when the first loop is returning no result, I am noticing the error. However if the first loop returns results I get no issues.

    Any ideas?

    Thank you.

  4. degmsb
    Member
    Posted 1 year ago #

    Any update on this? Here is some behavior I have noticed:

    Except for one custom taxonomy page, the plugin is working on all of my site with no notices. But on that one page I get this notice and the facbook button does not show.

    Notice: Trying to get property of non-object in /home3/fefer/public_html/wp-includes/post-template.php on line 29

    I have reviewed line 29 and here is what I think is happening.

    My taxonomy page has two main custom queries built into it and two wordpress loops. These queries modify the main wordpress query for the page.

    It seems if the first query does not return results then it causes the error above if the plugin is active.

    However, if the first query returns results then there is no error and the plugin works fine even if the second query returns results.

    And if the plugin is not active I get no error whether the first query returns results or not.

    I also tried turning off the facebook setting in the admin of the plugin. But the notice still happens.

    Any help you can provide is much appreciated! Thank you!

  5. degmsb
    Member
    Posted 1 year ago #

    Here is an update, I think I have narrowed down why the error happens. Basically if there are no posts set to published the error happens. But when you add just 1 published post the error does not happen and everything works fine. This is an issue for me because my custom taxonomy page publishes draft posts and published posts. So if a particular geography only has a draft and not a published post, I get an error.

    Can you fix this in the plugin?

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic