How to use any font without image?

We always wanted to use custom fonts in web pages. But due to the limitation of fonts in visitors system. We were compelled to use certain fonts. But now you can generate your font files and use it in your web.

Follow the following steps to use custom fonts in your webpage.

1. Convert your font to js
Convert your font to js readable from http://cufon.shoqolate.com/generate/.

2. Download cufon.js
Download cufon.js from http://cufon.shoqolate.com

3. Embed
Embed cufon.js and your font js file to your web

4. Specify Elements to transform

Cufon.replace('h1');

5. Demo

http://www.dineshkarki.com.np/demos/fonts/

Exclude Page From WordPress Search

WordPress, by default search for post and pages. How ever you can add a filter to exclude page or post to make you search result effective.


Open your functions.php from your active theme and use the following Code.


function SearchFilter($query) {
if ($query->is_search) {
$query->set('post_type', 'post'); // Displays only post. Change it to 'pages' for pages.
}
return $query;
}

add_filter('pre_get_posts','SearchFilter');


Add widgets from shortcode in post/page

WordPress Widgets can be easily customized and used in your theme using dynamic_sidebar(‘WIDGET NAME’) function. But when the time comes to use it in page or post it is not that easy. As the page and post only accepts shortcodes,  you need to write a shortcode which will get contains from widgets. Below you can see steps to call widgets from shortcode.

1. Register A Sidebar


register_sidebar(array(
'name'			=> 'My Sidebar',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
));

2. Create a function to read sidebar


function get_my_sidebar($output) {
ob_start();
dynamic_sidebar('My Sidebar');
$output = ob_get_contents();
ob_end_clean();
return $output;

3. Create Shortcode


add_shortcode('sidebar_shortcode','get_my_sidebar');


4. Use it
Use


[sidebar_shortcode]

in post/page to get the widgets assigned in sidebar.

Note
Use these codes in functions.php of your active theme.