content of the page is not displaying getting empty page [closed]
The function is called the_post() (no plural s).
The function is called the_post() (no plural s).
Instead of cooking up your own PHP file and trying to bring in WordPress functionality, put the functionality inside of WordPress using the AJAX hooks that are designed to do that sort of thing. More info here: http://codex.wordpress.org/AJAX_in_Plugins
Note, Session must start before header is sent. So you should try – <?php if( !session_id() ){ if( headers_sent() ){ die(‘headers already sent, cant start session’); } else{ session_start(); } } // check existence, or not below 1 if( !isset($_SESSION[‘impression’]) || $_SESSION[‘impression’] < 1 ){ $_SESSION[‘impression’] = 100; } // decrease the value by one … Read more
Note that simply bootstrapping directly for a one off temporary file is never the optimal solution, and bad practice, and tends to introduce lots of problems. E.g. in your case, you might have WordPress functions available, but no theme files or APIs are triggered. Instead, there are better ways to do it. This isn’t considered … Read more
You should never create standalone files to do things like this. This is one of the reasons timthumb turned into a security nightmare, and it’s incredibly fragile and dangerous. WordPress is a CMS, and it should handle all requests. Instead, use GET or POST variables in the URL to do the work inside WordPress, by … Read more
i found the problem there was space in function.php
As I’ve mentioned in the comments – you shouldn’t need to modify / touch WordPress globals directly. It seems you are getting the errors because you are trying to load WordPress within Smart – this is a bit of a hacky approach. I’ve not used Smarty at all, but WordPress has its own way of … Read more
To send HTTP headers just do it early enough. On the action wp_loaded for example. Don’t forget to call exit; when you are done, so WordPress doesn’t send its own headers later. See also How to Rewrite WordPress URL for a Plugin
You should include your includes/authentication.php in your myplugin.php like that: include(‘includes/authentication.php’); You can use all the WordPress-Functions there. If there are any specific functions that don’t work for you, please list them, and show us how you included your includes/authentication.php.
To call hook on a php external file