Forums Forums Search & Filter Pro Using Ajax with custom post type..Shortcode content not displaying

Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
  • Anonymous
    #225094

    I’m loading custom post types by ajax search. Eveverything is fine apart from when I add a shortcode or an action from the plugin “GD Mylist”

    Here is a link http://wordpress-256456-1039656.cloudwaysapps.com/

    Hope you can advise me on how to solve this 🙂

    Trevor
    #225107

    Where are you adding the shortcode/action? On the search page or in the posts that you are searching?

    Can you explain (maybe using videos or screenshots) what goes wrong? Any image or video you want to show me must be uploaded to a file sharing site and then share the link(s) with me.

    Anonymous
    #225144

    I put it in the loop in the results.php file…

    Image ‘0’ in the files shared below has the action highlighted.

    1mage ‘1’ has the ‘add to wishlist’ button being rendered as expected on the front end. when loading the page using the results.php file to list the custom posts. However when I select a checkbox in the search form, the result are filtered by ajax, and those results no longer have the add to wishlist button on them..that is shown in image’2′

    https://we.tl/t-z5fQjla7Ik

    https://wordpress-256456-1039656.cloudwaysapps.com/

    Anonymous
    #225146

    ps. everything works fine without ajax

    Trevor
    #225166

    Ah. I understand.

    On initial page load, WordPress runs through the shortcodes and executes them. But, an Ajax load only refreshes part of the page, and whatever code that was run on page load, is not triggered again.

    Whilst I can give you some JavaScript that will execute on Ajax refresh, I do not know what that plugin requires to be run again on an Ajax refresh.

    It is highly unlikely that the author of that plugin has not been asked this before, but I can see nothing on Google. Our JavaScript looks like this:

    <script>(function ( $ ) {
      "use strict";
      $(document).on("sf:ajaxfinish", ".searchandfilter", function(){
        console.log("ajax complete");
    
    // call your GD Mylist function here
    
      });
    }(jQuery));</script>

    But for what goes there, you need to ask the plugin author if they can help. They may come back and say, ‘Don’t use Ajax.’

    Anonymous
    #225170

    Thankyou.. I will try to contact the plug-in author. Should I put that JavaScript at the bottom of the page?

    Trevor
    #225172

    Without their code, it will do nothing, but, in the footer is fine.

    Anonymous
    #225205

    Thanks for your help..managed to get it working, in the end, using a different plugin.

    I’m having a slight issue now with the text search input..I have checkbox inputs that are working fine. However, the text input search is reloading the page every time I click near it?

    https://wordpress-256456-1039656.cloudwaysapps.com/

    That is the link so you can see what I’m talking about, hope you can shed some light.

    Regards,

    Dave

    Anonymous
    #225221

    Sorry..my mistake, I had a an unclosed link tag above the form.

    Trevor
    #225223

    Is this issue now resolved?

Viewing 10 posts - 1 through 10 (of 10 total)