custom wordpress post loop – hide iframe content

the best solution is to add filter in your functions.php : add_filter(‘the_content’,’show_only_thumbnails’,99); function show_only_thumbnails($content){ if(is_home() && is_front_page()){ //quote from : //http://wordpress.stackexchange.com/questions/218305/display-only-text-to-wordpress-loop-without-loosing-the-text-formatting/218314#218314 $content = preg_replace(‘/<iframe.*?>/’, “”, $content); // removes iframes return $content; } return $content; }

how load content as pop-up using ajax

If you want to load PHP file through AJAX use the below code. function sendAJAX(){ $(‘#container’).load( “stuff.php”, // url { // json object of data to pass to the page stuff: “all your stuff goes in here…”, moreStuff: “even more stuff” }); console.log(‘sendAJAX’); }; Let me know, In case of any doubts.