Forum Replies Created

Viewing 1 replies (of 1 total)
  • websolman

    (@websolman)

    Hi! 😊

    I ran into the same issue and found the cause — it’s not actually the function itself, but the quotes around the function name.

    When copying the code from the web, the quotes were automatically changed into “smart quotes”, which PHP doesn’t recognize as valid.
    Because of that, the if ( ! function_exists() ) check fails, and the function gets declared twice.

    Here’s the difference 👇

    ❌ Wrong version (smart quotes):

    if ( ! function_exists(‘color_palette_grid’) ) {

    ✅ Correct version (straight quotes):

    if ( ! function_exists( 'color_palette_grid' ) ) {

    Always make sure to use straight single quotes ' ' in PHP — never “curly” ones ‘ ’, or you’ll get a “Cannot redeclare function” error again.

    Hope this helps someone else! 🚀

Viewing 1 replies (of 1 total)