-
Published on :
13
October
11
-
by :
Dinesh
-
in :
Wordpress
-
Comments :
0 Comments
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');
-
Published on :
03
May
11
-
by :
Dinesh
-
in :
Web Developement, Wordpress
-
Comments :
0 Comments
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.
-
Published on :
03
May
11
-
by :
Dinesh
-
in :
Css, Web Developement
-
Comments :
1 Comment
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/
-
Published on :
03
May
11
-
by :
Dinesh
-
in :
Firefox, Web Developement
-
Comments :
0 Comments
Here is the list of Firefox add-ons which will help you in the web development.
1. Firebug
With this addon you can edit, debug, inspect your html elements, css, javascript, ajax request/response.
2. MeasureIt
Used to drag out a ruler to get the pixel height and width of any element in web page.
3. Modify Headers
This addon gives feature to add, modify, filter you HTTP request headers. Widely Used for the web service development for smart phones.
4. Fireshot
Adds ability to take screenshot of entire/portion of webpage. You can edit your screenshot with annotation tools for text, highlights etc.
5. Dummy Lipsum
Generates Lorem Ipsum dummy text. You can specify the number of paragraphs and words to generate.
6. ColorZilla
Provides eyedropper and color picker to get the color reading from any point of the web.
These are the addons that i am using for the web development. If you have more… Share It.
How to install addons in firefox?
- Go to Tools -> Add-Ons
- Click on Get Add ons tab
- Search Addons
- Click on Add To Firefox
-
Published on :
19
April
11
-
by :
Dinesh
-
in :
Skype
-
Comments :
1 Comment
Do you want to use skype button in your webpage to notify your skype status? You can get your skype button and embed in your webpage. Follow the link below to get your skype button.
http://www.skype.com/intl/en-gb/tell-a-friend/wizard/
OR
http://www.skype.com/intl/en/tell-a-friend/get-a-skype-button/
Note
Make sure you have enabled Allow my online status to be shown in web under Tools -> Options -> Privacy Settings
Demo
