• Resolved akshat

    (@akshat007)


    Hi,
    Hope you are doing well!
    I am using your plugin for my website. In normal posts everything works fine. But the issue is I am fetching the post content in my functions.php through ajax and passing it though apply_filters(the_content,post_content). This results in working of all other shortcodes of theme and plugins except the tablepress shortcode. It is not rendering table and getting printed as [table id=xx]. Can you please help me in this scenario. I have tried loading you front end controller as well but that works only when I have to pass the hard coded short-code not for this scenario. Any help would be really appreciated!!
    Thanks

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Loading the Frontend Controller should actually work here, as that’s what’s registering the Shortcode. Normally, they don’t get registered in AJAX requests, as they are (usually…) not needed there.
    So, how are you loading the frontend controller? Are you running its init method?

    Regards,
    Tobias

    Thread Starter akshat

    (@akshat007)

    Hi,
    Thanks for prompt reply!
    In my functions.php in the function where I am showing post content through apply_filters(xxx) just before this I am passing
    TablePress::$controller = TablePress::load_controller( ‘frontend’ );
    I guess it will load the controller but still when the content is rendering at front end the shortcodes are not rendering and they are getting printing as [table id= xx].

    Thanks

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    please also add the line

    TablePress::$controller->init_shortcodes();
    

    Regards,
    Tobias

    Thread Starter akshat

    (@akshat007)

    That works! Thanks a lot for the awesome support you provided. That deserves a five star rating. One more question is your plugin compatible with genesis framework?

    Thanks

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! ?? Good to hear that this helped!

    I don’t see why the plugin should not be compatible with that theme framework.

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Shortcode Not Working When fetching post content via Ajax’ is closed to new replies.