Sunday 17 May 2015

Remove Image Title In Wordpress

Hello All,

Some Time you have requirement to remove image title in wordpress site.
but you added lots of image and also if you can change manully then it so
long work.

when yon remove image title  content. you can use this code and check it.

it's only change when you added image in wordpress editor. but when you can
create plugin on use any plugin in when added image title that can not remove that.
there you can use simple Jquery

Use  AnD Remove Image Title In Content Filter check below code.

This code added in you current theme functions.php also you can create plguin for it

add_filter('the_content', 'remove_images_titles');
function remove_images_titles($text) {

    // Get all title="..." tags from the html.
    $result = array();
    preg_match_all('|title="[^"]*"|U', $text, $result);

    // Replace all occurances with an empty string.
    foreach($result[0] as $img_tag) {
        $text = str_replace($img_tag, '', $text);
    }

    return $text;
}


But you can remove image title in all wordpress site follow simple jquery and 
check result

jQuery(document).ready(function($) {
$("img").removeAttr("title");
}

this code added in your header.php after added all script in wrdpress.

refresh your site check it using firebug it can be remove image title.

please tell me this can be helpfull or not? comment Please?


Monday 11 May 2015

Change xampp or Wamp apache port number

Hello All,

Chnage xampp or wamp apache port number 


I am Just here Tell you How to change xampp or wamp apache port number.
Chnage xampp or wamp apache port number


In Wamp and xampp apache port in 80. 80 is it's defualt port in wamp and xampp.

so some time issue with in skyppe,sql server because then also use port 80.

if we want to use xamp and wamp port 80 then we can stop service sql sql.

and in skypee you can stop to use 80 port then follow below step

1) first goto skypee 
2) tools -> options
3)in options -> advance tab -> connection
4) Then un check the check box of use port 80 and 443 for addtions incoming connections

Change Wamp apache port number 

Step1 ) Open file "httpd.conf" with notepad++ or any editor you can use like (dream viewer,PHP designer) in  D:\wamp\bin\apache\Apache2.4.4\conf\original

Here I am Install in D Drive then my path is that. when you install wamp 
check there. "youWamp Install Drive"\wamp\bin\apache\Apache2.4.4\conf\original

Step2) After Fine use ctrl+f and find "80", the are 2 places which you need to change.

step 3) Change port 80 to be ther number, such as 88(as you wish)

step 4) After changes, restart the wamp

now listen 80 to listen 88

and servername localhost 80 to localhost:88

but make sure that new port change in httpd.conf can not use any another program.


Change Xampp apache port number 

Step1 ) Open file "httpd.conf" with notepad++ or any editor you can use like (dream viewer,PHP designer) in  E:\xampp\apache\conf

Here I am Install in E Drive then my path is that. when you install wamp 
check there. "your Xampp Install Drive"\xampp\apache\conf

Step2) After Fine use ctrl+f and find "80", the are 2 places which you need to change.

step 3) Change port 80 to be ther number, such as 88(as you wish)

step 4) After changes, restart the xampp

now listen 80 to listen 88

and servername localhost 80 to localhost:88

but make sure that new port change in httpd.conf can not use any another program.

Change xampp or Wamp apache port number

In localhost access this type locahost:88/blogger 

Give Me Comment is blog usefull or not 

Thanks






Thursday 7 May 2015

Contact form in Wordpress



Contact form in Wordpress


Hello  All,

Mostly Use Contact Form In Web site.

I am Create simple code  for add contact form in wordpress.

It's Only Example No Plugin required. You can also Custimise;

I am create Name,Email,Message Fild in wordpress;

CREATE TABLE IF NOT EXISTS `wp_myphpinformation` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(100) NOT NULL,
  `email` varchar(100) NOT NULL,
  `message` varchar(225) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

I am create this table in my php admin.

Create templete In Wordpress


/*
Template Name: My Custom Page
*/

Copy the page.php of your current theme and change name like contactform.php

After adding a comment and check with your admin this template.


I am here add full Ecample Code Check IT. I hope you like;

it's contactform.php

<?php

/*
Template Name: My Custom Page
*/
?>
<?php get_header(); ?>
<?php
        if (!empty($_POST)) {
        global $wpdb;
            $table = wp_myphpinformation;
            $data = array(
                'name' => $_POST['yourname'],
                'email'    => $_POST['email'],
                'message' =>  $_POST['message']
            );
            $format = array(
                '%s',
                '%s',
                '%s'
            );
            $success=$wpdb->insert( $table, $data, $format );
            
            
            if($success){
            echo 'data has been save' ; 
}
}
else   {
?>
        <form method="post">
       

Contact Me

        <input type="text" name="yourname"/><br />
        <input type="text" name="email"/><br />
        <textarea name="message"></textarea><br />//textarea code
        <input type="submit"/>
        </form>

       <?php }  ?>
       <div class="contact">
       <table>
        <tr>
        <td>Name</td>
        <td>Email</td>
        <td>Message</td>
        </tr>
       <?php 
       
       $results = $wpdb->get_results( 'SELECT * FROM wp_myphpinformation', OBJECT );
       
       foreach($results as $result){?>
        
        <tr>
        <td>php echo $result->name; ?></td>
        <td>php echo $result->email; ?></td>
        <td>php echo $result->message; ?></td>
        </tr>
        
        
        
      <?php }
       
       ?>
       </table>
       </div>

<?php get_footer(); ?>

Monday 4 May 2015

Errors file upload in PHP

Hello

Here Very small errors are found in file upload.

You can find the code for file uploading from the internet  but you can make some mistake.

I Will oberserve you. mostlly mistake in file upload.

1) in form html enctype="multipart/form-data"


<form action="" method="post" enctype="multipart/form-data">
    Select image to upload:
    <input type="file" name="fileToUpload" id="fileToUpload"/>
    <input type="submit" value="Upload Image" name="submit"/>
</form>

when you use input type file then you must write enctype="multipart/form-data"
it's recuired otherwise it can not upload file or get issue or error in file upload code.

2) just check file_uploads = On in your php.ini file.

Friday 1 May 2015

Parallax Scroll and Back to Top Using Jquery

Parallax Scroll and Back to Top Using Jquery


Hello
Here you can create parallax scroll and back to top using jquery.

just you can add jquery in your html 


i am write script here give smaple code then check it your html

here sample code


please check it 

here i  add simple jquery scripy

<script type="text/javascript"&
gt;

jQu
ery( document ).ready(function() {
    
    jQuery('.tryitbtn a').click(function() { 
     if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
      var target = $(this.hash);
      target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
      if (target.length) {
        $('html,body').animate({
          scrollTop: target.offset().top
        }, 1000);
        return false;
      }
    }
  });
    
    jQuery('a.back_t').click(function () {
        //alert('hi');
jQuery('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
  
})
;

</
script>