Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1130761

    Hi There,

    I have the following problem; the response of a GET request is not shown in the browser.

    What do I want to achieve;
    I have a projects (custom post type) overview page, where by default I display all projects with pagination. There are 3 types of project, the type of the project is a custom value (which is more convenient for the rest of the project). I want to let the visitor also view one specific type of projects. Visitors can do this by clicking on a button for the specific category. The project overview page is a custom template page, http://localhost/bdf/projecten-overzicht/. With a button I fire a get request to ; http://localhost/bdf/projecten-overzicht?categorie=ONDERWIJS.

    Before adding “remove_action(‘template_redirect’, ‘redirect_canonical’);” to functions.php I got 2 responses the first a 301 and the second a 200. If I go to the Network tab (Chrome) and look at the preview, I see the page I want, the projects for that specific category with pagination. But the page is not displayed. With adding the “remove_action” to functions.php I only get the 200 response but still the response isn’t displayed, it still shows the original page with all types of projects.

    So I’m a bit stuck here, can someone point me in the right direction?

    This is the header

    Kind regards,
    Sander

    #1131623

    Hey sanderjaasma,

    Thank you for using Enfold.

    Are you using the default “redirect_canonical” function from WordPress, or is that a custom function you created? Why are you doing a template redirect? You can parse the query using JavaScript or fetch it from the $_GET variable.

    // https://codex.wordpress.org/Function_Reference/redirect_canonical
    // https://codex.wordpress.org/Plugin_API/Action_Reference/template_redirect

    If you want to get the query using JS, try this.

    // https://stackoverflow.com/questions/2090551/parse-query-string-in-javascript

    Best regards,
    Ismael

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.