Posts

Wordpress plugin development

Hi friends this is my very first tutorial in wordpress plugin development. In this tutorial we are going to create an login/logout widget as a plugin. step 1: Create a folder in wp-content/plugins/ and name it as whatever u want. But it should represent your plugin name, here i'm going to create an folder ' ktm-wp-login '. Now the folder will be in wp-content/plugins/ktm-wp-login. step 2: Create a file ktm-wp-login.php inside the ktm-wp-login folder and write the following code on it. /* Plugin Name: ktm Wordpress Login Description: With this plugin we can login or logout. Author:Karthi Version:1.0 Author URI:http://techpointt.wordpress.com Plugin URI:http://techpointt.wordpress.com */ step 3: For creating this plugin we need the following functions and hooks: - wp_loginout() - wp_register() - register_widget() and an action ' widgets_init ' Lets start, In order to register our widget we need a function register_widget() <?php add_action('widgets_init',...

Refresh/Reload Page or Part of the Page Automatically/Periodically - Javascript

Here is the source to know about automatically refreshing particular part of page. Refresh/Reload Page or Part of the Page Automatically/Periodically - Javascript .

Resize parent colorbox iframe size

If we are loading some content within already existing iframe it will not resized automatically. It will show only it's initial width and height. We can modify that parent iframe property by calling parent.$.fn.colorbox.resize(). Within that we can give our innerWidth and innerHeight. parent.$.fn.colorbox.resize({innerWidth:600,innerHeight:400}); Add this code inside ur script.

Passing Javascript variables to PHP

It's easy to get Javascript variable into PHP. What you have to do is follow below code. //in script block var veg = 'Carrot'; //in php block $veg = "<script type='text/javascript'>document.write(veg);</script>"; echo 'Printed My JS variable into PHP: '.$veg; Result will be: Printed My JS variable into PHP: Carrot

CakePHP Auth component

Hello friends, If you have any doubt or want to learn authcomponent just watch this video.

Change default redirection URL in wordpress

wordpress login redirect: Open your WordPress/wp-login.php file, and find this line: $redirect_to = admin_url(); and replace it with this: $redirect_to = get_option('siteurl'); After login, Page will be redirected to home page Wordpress logout redirect: find this code wp_safe_redirect( $redirect_to );   in Switch statement and in case 'logout:' Then add this code before that line $redirect_to = get_option('siteurl'); Modifying core file is not a good way, if you dont want to modify core file try some nice plugin for wordpress redirect.