All posts in Uncategorized

Get accurate height of iframe of cross domain with no scroll

Create first webpage and include below code into this page

window.addEventListener('message', receiveMessage, false);

function receiveMessage(evt)
{
    alert("got message: "+evt.data);
}

Now create another webpage on other domain that you going to call in iframe inside first page and include below code into this page.

window.parent.postMessage('Hello Parent Frame!', '*');

when you will view first page , a message will be sent by cross domain webpage inside iframe and your first page will receive it and generate a alert.

you can change this alert event to some other even easily by editing first page code.

How to know the consumed amount of internet data of photon postpaid connection

photon daily consumption enquiry 7208012345

Above is the no if you want to know your tata photone data consumed till the day dial this no from phone no registered during getting the connection.

If, in any case it didn’t work. Just call the customer care no.

Change the title and email id of emails sent by wordpress automatically

Here again a better easy answer.

Mostly when setup WordPress for multi user registration, you will rarely notice that title and email address of mail sent by backed is something like title:  WordPress and sent by wordpress@example.com

But here i have a very easy way to change them with the name and email id of admin user automatically . Whenever you change admin email it up going emails will be sent by new email id set in admin profile.

So the magical code is as below:


/* admin */
function wpc_fromemail($email) {
$wpfrom = get_option( 'admin_email' );
return $wpfrom;
}

function wpc_fromname($email){
$wpfrom = get_option( 'blogname' );
return $wpfrom;
}

add_filter('wp_mail_from', 'wpc_fromemail');
add_filter('wp_mail_from_name', 'wpc_fromname');

Create a new field to upload logo in wordpress theme

As previously, i was a front-end developer. I always try to find more convinient and user friendly answers for my problems.  as i have found a very important and necessary logo upload field that every custom WordPress theme developer should implement in its there for more convenient and user friendly template.

Below is the code to paste at the bottom of function.php in your theme folder.



// insert logo

function themeslug_theme_customizer( $wp_customize ) {

$wp_customize->add_section( 'themeslug_logo_section' , array(

'title' => __( 'Logo', 'themeslug' ),

'priority' => 30,

'description' => 'Upload a logo to replace the default site name and description in the header',

) );

$wp_customize->add_setting( 'themeslug_logo' );

$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'themeslug_logo', array(

'label' => __( 'Logo', 'themeslug' ),

'section' => 'themeslug_logo_section',

'settings' => 'themeslug_logo',

) ) );

}

add_action('customize_register', 'themeslug_theme_customizer');

/*


Filter the name and email address from wp_mail


By www.agentwp.com



*/

    $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'custom_logo', array(


        'label'   => 'Custom logo',


        'section' => 'ignite_custom_logo',


        'settings'   => 'custom_logo',


    ) ) );


}


Now there will be a new option available in your theme customizer  for logo upload.

Now we have a field but how to echo this field value in your theme?

And answer is below code.



< a shape="rect" class="logo" href="" title="" rel="home">< img src="< /a>




And you can also use this to create and access as many fields you want . Just customize the code (very easy) and its ready with new field

creating database on phpmyadmin (mysql server)

create-server
Now i will explaing you easy way to create database in phpmyadmin.
Point your browser to phpMyAdmin address, http://localhost/phpmyadmin.
Enter your user name and password if asked, bydefault username is ‘root’ and password is nothing. plz dont use nothing word for as password.
You will get first page/home page from phpMyAdmin. Enter name of database that you want in ‘create new database’ field.
If success, you will get like following screen:
thanks, if you want to support us . join our blog and start inposting instrusting articles it ralated.