• Hi Paul!
    Its me, Brian the Pest again!
    I noticed that a php warning is being thrown as follows:
    Notice: Trying to get property 'post_content' of non-object in /path/to/wp-content/plugins/pj-news-ticker/pj-news-ticker.php on line 200
    On a single category page.
    Plugin version 1.9
    WP 4.7
    Php 7.13
    Memory 8196
    Just FYI! Just trying to help!
    Thanks as always!
    @brianbrown

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Primitiv Media

    (@nicolasmontigny)

    Hi Brian,

    I’m not sure how to reproduce this error. Would you be able to provide us with more details in order for us to address this issue?

    Cheers and happy holidays

    Plugin Author Primitiv Media

    (@nicolasmontigny)

    Hi Brian, I haven’t heard back from you yet. I will wait another week before closing this topic.

    Cheers and stay safe

    Thread Starter Brian Brown, Ph.D.

    (@brianbrown)

    Hi Pail!
    This occurs (I replicated it on a fresh install) when there are no posts in the chosen category.
    Its not a big issue, just a warning that I thought I would bring to your attention (and only shows when the debugger is on). Having said that, the ‘There are no matching posts to display’ is correctly output, however. So the logic is correctly identifying that there are no posts.
    Best for the New Year!
    -Brian

    Plugin Author Primitiv Media

    (@nicolasmontigny)

    Hi Brian,

    We have just pushed an update to fix this problem. Thank you for your help!

    Happy new year ??

    Cheers and stay safe

    Thread Starter Brian Brown, Ph.D.

    (@brianbrown)

    Hi Paul!
    I’m still seeing this warning on ver. 1.9.2 on an existing install (with >78,000 posts).
    Thanks!
    -B

    Plugin Author Primitiv Media

    (@nicolasmontigny)

    Hi Brian,

    To confirm this happens when you use the shortcode on the page and manually set post_cat to an empty category?

    Regards,
    Primitiv Media

    Thread Starter Brian Brown, Ph.D.

    (@brianbrown)

    I am calling it like this:

    <div class="headline"><?php
    		if (defined('PJNT_VERSION')) {
    			$pjshortcode = '[pj-news-ticker show_label="false" label_bg_colour="transparent" ticker_bg_colour="transparent" speed="120"  gap="false" custom_separator="&hellip;&nbsp;" target="_self"';
    if(isset($taxonomy->slug)){echo do_shortcode( $pjshortcode.'post_cat="'.$taxonomy->slug.'"]');}
    			else {echo do_shortcode( $pjshortcode.'show_label="false" ]' );}}
    		else {echo 'WELCOME';}
    ?></div>

    So, perhaps I will test for an empty taxonomy slug, but, by default, WordPress ALWAYS has at least one category, so this should not be necessary.
    It seems to be okay now, so maybe I was looking at a cached page (I don’t know how, since the cache gets cleared upon any update).
    I guess we can mark this as resolved for now.
    Thanks!
    -Brian

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Throwing php warning’ is closed to new replies.