Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • I seem to have the same problem as you, however my posts or pages do not return 404 errors, they return the content of the home page. I fixed it by saving the polylang permalink related settings again. However, this fix is ​​only temporary. If you take other actions related to updating data on the website, the above error seems to occur again.

    Thread Starter khanhfe

    (@khanhfe)

    Oh, I just reviewed your code. And I see I do the same and even shorter, however it fails and doesn’t work.:>

    Thread Starter khanhfe

    (@khanhfe)

    Yeah!
    Thank you very much! I see your enthusiasm and am grateful for it! In the meantime waiting for your solution, I went back to the method I was thinking of as an alternative to ajax and it seems to be acceptable. Thank you again!

    Thread Starter khanhfe

    (@khanhfe)

    Or can I somehow create a link to another quiz? In this case no longer using ajax, however I think it’s the ultimate solution to what I’m having!

    Thread Starter khanhfe

    (@khanhfe)

    Hmm,
    After trying to follow your instructions, i actually still only get a tag which is the data returned from the server. Also, I tried to run HDQ_INIT(), however, the browser console only logs one more time the message “HD Quiz Init” without any other changes. I tried to figure out why but still can’t understand the working flow of this plugin so I still need your help!
    Thank you very much for your enthusiastic support!

    Thread Starter khanhfe

    (@khanhfe)

    Hi @harmonic_design,
    I want the user to continue taking a new quiz after completing a previous quiz. However, I couldn’t find any solution, so I thought of passing a parameter to the do_shortcode function through the wordpress ajax, so that the server can execute this function. However, on the client side (front-end) I only get 1 a tag and my href attribute is empty, so when I click it it just reloads the page.

    The code that I write in the theme’s function is as follows:

    add_action( 'wp_ajax_nopriv_handle_ajax_shortcode', 'handle_ajax_shortcode' );
    add_action( 'wp_ajax_handle_ajax_shortcode', 'handle_ajax_shortcode' );
      function handle_ajax_shortcode(){
        $content = $_POST['dataShortcode'];
        $data = do_shortcode( $content );
        wp_send_json_success($data);
        wp_die();
      }

    Hope the above information can be useful to you. Now I have found an alternative solution but I feel it is not optimal so I would still appreciate your help.
    Thank you so much!

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