• Resolved Sameer Panje

    (@sameerpanje)


    Hi,

    I’m building a new site on WordPress 4.4 and it requires me to use custom query vars for some sections. I’ve been using this feature for a couple of years now and things have been pretty smooth so far. However, when I added my usual code for registering the custom query vars on this site, it gives out a Server Error (#500).

    Here’s the code I’m using…

    //Add custom query var filter
    function parameter_queryvars( $qvars ) {
        $qvars[] = 'req_id';
        $qvars[] = 'service_name';
        return $qvars;
    }
    add_filter('query_vars', 'parameter_queryvars' )

    I’m at a loss of thoughts as to why this is happening since the same code is running fine on other websites on my localhost as well as live server (not version 4.4 though). Has there been some change in 4.4 that requires me to do things differently?

    Please help!

    Thanks ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Sameer Panje

    (@sameerpanje)

    Just in case it matters, I’m using a self-created child theme for the Divi theme from Elegant Themes for this website.

    The error occurs as soon as I add the function to my theme’s functions.php file and try to load any page on either the front-end or admin panel.

    Thread Starter Sameer Panje

    (@sameerpanje)

    My bad…I didn’t notice that I hadn’t terminated the last statement in that code. Apologies.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding custom query vars breaks my site’ is closed to new replies.