Archive for February, 2014

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