Custom post type redirect to 404 page in wordpress

Unknown | 8:17 AM
Custom post type redirect to 404 page in wordpress Problem: When i create my custom post type in functions.php it works for listing the records on template file but when i click the permalink it redirects me to the Page Not Found(404) page. Solution: Type this function before your custom post type code  flush_rewrite_rules(true); This will work Still if you are getting problem then go...

How To compress all files within a directory using PHP

Unknown | 8:20 AM
How To compress all files within a directory using PHP To do this create a "zipcode.php" file where you want to create the zip file $zip = new ZipArchive(); $zip->open('example.zip',  ZipArchive::CREATE); $srcDir = "/public_html/example/test/"; $files= scandir($srcDir); //var_dump($files); foreach ($files as $file) {   $zip->addFromString(basename($file),  file_get_contents($srcDir.$file));...

Add Filter after posting a comment

Unknown | 8:47 AM
Add Filter after posting a comment add_filter("comment_post", "email_project_designer"); function email_project_designer(){ //  Your custom code    wp_mail( 'abc@example.com' , 'subject','message' );...

Send mail to the user when comment gets approved in wordpress

Unknown | 8:38 AM
Send mail to the user when comment gets approved in wordpress Action hook after comment approval function notify_approval_to_contributor ($comment_id){ $comment = get_comment($comment_id); if ($comment->comment_approved == 1) { $postdata = get_post($comment->comment_post_ID); $author = get_userdata($postdata->post_author); $user_id= $comment->user_id; $notification_meta_for_user...

How To Call Wordpress functions on core php file or a simple template file

Unknown | 8:29 AM
How To Call Wordpress functions on core php file or a simple template file require_once("../../../wp-load.php"); Add this file on the top of your page the path should be correct This works fine use this...

How to use Ajax in Wordpress

Unknown | 12:04 PM
How to call wordpress function using Ajax How to call wordpress function using Jquery Simple wp ajax example Put this code in your template file like home.php <input type="text" id="txt"  />     <button>GO</button> <div id="ajax"></div> Create a file //custom.js jQuery("button").click( function (){     var name=jQuery("#txt").val();                                       ...

Sending HTML Email with PHP

Unknown | 12:40 PM
How to send email with HTML tags in PHP $to      = 'example@example.com';$subject = 'Testing Mail with HTML'; $message = '<html><body>';$message .= '<table rules="all" style="border-color: #666;" cellpadding="10">';$message .= "<tr style='background: #eee;'><td><strong>Name:</strong> </td><td>" . strip_tags($_POST['name'])...

How To Play and pause video in jQuery

Unknown | 12:16 PM
  After clicking on close button this jquery will work  $( "#closethis" ).click(function (){ // You can use play and pause to stop and play the video            $("video").trigger("pause");    // used for fadeout video section slowly         $( ".video_section" ).fadeOut(1000); }...

Responsive design - Media Query not working on iPhone?

Unknown | 12:09 PM
Issue:-- I have created some media queries, that working fine in a browser when resizing on a desktop. But not for i phones and Tablets gadgets  Do you have the meta for view port in your html? Paste this meta in your Html i.e after <Title> tag <meta name="viewport" content="width=device-width, initial-scale=1.0;">...

How to show event image in event management plugin

Unknown | 6:47 PM
How to show event image in event management plugin Event image is not showing in event management plugin show event image through php code using event management plugin Your Solution: suppose you want to show event image on You own posted event Then go to plugin Events-management->templates->Tables-> events.php add the below code where you want to show your event image <img src="<?php...

Avinash Kumar Singh © 2013. All Rights Reserved | Powered by-Blogger