http://wordpress.org/support/profile/mr49online

Archive for the ‘Wordpress’ Category

WordPress tutorial for beginners


Start learning wordpress in just 10 minuts with Handouts by Irfan bhai.

For more detail regarding this post. 😉

Thanks.

Twenty Eleven: Chainging header font.


Please, paste this code in wp-content/themes/twentyeleven/style.css:

For site title: After line 518 :-
font:30px "Bookman Old Style" !important;

For site description: After line 529 :-

font:14px "Bookman Old Style" !important;

Don’t forget to update your required font name 😉

Twenty Eleven – How to resize header image


Please, open functions.php.

File Path: wp-content/themes/twentyeleven/functions.php.

move on line no. 122 and 123, to set its height and width parameters:
define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyeleven_header_image_width', 1000 ) );
define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyeleven_header_image_height', 260 ) );

Also, comment out these lines in style.css(line 530):

#branding img {
/*height: auto;*/
margin-bottom: -7px;
/*width: 100%;*/
}

Twenty Eleven theme: How to decrease spaces in header.


Please, open the style.css file of twentyeleven theme.

File Path: wp-content/themes/twentyeleven/style.css.

Reduce `padding-top: 3.65625em; in style.css(line 509) up to your requirement.

#site-title {
margin-right: 270px;
padding-bottom: 0;
padding-left: 0;
padding-right: 0;
padding-top: 3.65625em;
}`

Reduce margin-bottom: 3.65625em; in style.css(line 525) as per your requirement.

#site-description {
color: #7A7A7A;
font-size: 14px;
margin-bottom: 3.65625em;
margin-left: 0;
margin-right: 270px;
margin-top: 0;
}

How do I replace the text in the header with my logo in twentyeleven theme?


  • Open header.php file. (File path:  wp-content/themes/twentyeleven/header.php)
  • On line no. 74, update the anchor tag:
  • <h1 id="site-title"><span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?> </a></span>
    </h1>
  • Example:
  • <h1 id="site-title"><span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="wp-content/themes/twentyeleven/images/wp-logo.png"></a></span>
    </h1>

How to remove “/category/” from permalinks?


WP No Category Base Plugin:

As the name suggests this plugin will completely remove the mandatory ‘Category Base’ from your category permalinks ( e.g. myblog.com/category/my-category/ to myblog.com/my-category/ ).

Download this plugin.

For more detail please, click here .

How To Create WordPress Widgets


Create a new php file in your plugin directory called my-hello-world.php, and copy/paste the following plugin code:

<?php
/*
Plugin Name: Hello World
Plugin URI: https://mr49online.wordpress.com/
Description: Sample Hello World Plugin
Author: Muhammad Farhan
Version: 1
Author URI: https://mr49online.wordpress.com/
*/

function sampleHelloWorld()
{
echo "<h2>Hello World</h2>";
}

function widget_myHelloWorld($args){
extract($args);
echo $before_widget;
echo $before_title;?>mr49online widget <?php echo $after_title;
sampleHelloWorld();
echo $after_widget;
}

function myHelloWorld_init() {
register_sidebar_widget(__('Hello World'), 'widget_myHelloWorld');
}

add_action("plugins_loaded", "myHelloWorld_init");
?>

To activate this plugin move towards Admin > Plugins, and find “Hello World” from list.

To place this widget in Sidebar move towards Admin > Appearance > Widgets, and play with drag & drop 🙂

Fore more detail please, click here .

How to Include jQuery in WordPress (The Right Way)


Open the header.php file of your theme and paste the following code

<?php wp_enqueue_script("jquery"); ?>
<?php wp_head(); ?> 

Fore more detail please click here .