• Resolved mrprainx

    (@mrprainx)


    Hello everyone.

    In the last few days I’m getting an error on my posts where the star ratings are:

    "Notice: Undefined variable: pid"

    I’ve put the code manually in the single.php file. The code I used is the one indicated in the plugin settings:

    <?php if(function_exists("kk_star_ratings")) : echo kk_star_ratings($pid); endif; ?>

    What happened?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Kamal Khan

    (@bhittani)

    You haven’t define the variable $pid.

    Either set it manually to a post id e.g. $pid = 47;

    Or use $pid = get_the_ID(); if inside the wordpress post loop.

    Thread Starter mrprainx

    (@mrprainx)

    Thank you Kamal.

    Now it’s working properly.

    I’ve edited the line as follow:

    <?php if(function_exists("kk_star_ratings")) : echo kk_star_ratings($pid = get_the_ID()); endif; ?>

    Thank you again for your precious assistance.

    Have a nice day.

    Thread Starter mrprainx

    (@mrprainx)

    Resolved

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

The topic ‘Undefined variable: pid’ is closed to new replies.