Disabling Plugin Stylesheet

You must have seen that WordPress plugins can slow your site down with additional HTTP Requests such as adding their own stylesheet. For advanced users, who are adding custom styles for the announcement, you do not need to have an additional HTTP request for a useless stylesheet. Then add the following function in your theme’s functions.php file:

<?php
add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
    function my_deregister_styles() {
    wp_deregister_style( 'ninja-annc-css' );
}
?>
Advertisements

WordPress: Disabling Plugin Stylesheet

You must have seen that WordPress plugins can slow your site down with additional HTTP Requests such as adding their own stylesheet. For advanced users, who are adding custom styles for the announcement, you do not need to have an additional HTTP request for a useless stylesheet. Then add the following function in your theme’s functions.php file:

<?php
add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
    function my_deregister_styles() {
    wp_deregister_style( 'ninja-annc-css' );
}
?>

Adding a native WordPress gallery

I have heard a lot of talk lately of people complaining that they are unable to have image gallery’s in WordPress 2.8= without adding a plugin.  I assume this assumption comes from how hard it is to see what you can do when it comes to the gallery functions built into WordPress.   If you look at my gallery page, you will see a simple native WordPress gallery.  This gallery was built threw the theme but uses WordPress as it’s backend.

So How do I build a native WordPress gallery?

Well there’s two parts to accomplishing this successfully, but I’m only going to show you the first part in this post.  First you need to create a Category for all your gallery posts to be filed under. This Category may be named anything you would like it to be named.  I’m going to stick with the simple name of ‘Gallery’.  You will need some posts to be filed under it.  Create a new post as you normally would.  It is best to put some text to tell you readers what this gallery is all about, but that’s not needed.

Once you are ready to create your gallery, switch the editer from ‘Visual’ mode to ‘HTML’ mode (on the top right).  Once in ‘HTML’ mode, enter:

[ gallery ]

note: there should be no space between the brackets and the word ‘gallery’ (if I were to enter this line on my page, without the spaces, I would create a gallery).

Now switch back to the ‘Visual’ mode and you should see a new yellow box in your post box with an image of a camera with a photograph behind it.  If you move your mouse over this new yellow box, two new icons will appear.  From this point, just upload photos to your site and save it.

After you have uploaded your images, save the post and check it out on your website.  Depending on your theme, you should see a nice full gallery on your page, or as I have, just a single thumbnail on your index page, but the full gallery on the posts page.

Displaying one category on your WordPress main page

If you would like to only display a single category on your WordPress main page, here’s how you do it. You will need to start out by getting ID of the category you wish to display.   In WordPress 2.7+,  start out by going to your categories tab under posts(1), then hover over the category you would like to display in your post(2), don’t click on it, just hover over it.  On the bottom of your screen, you will be shown then URL of the category your hover over(3), remember the ID number that being displayed.   In the below example the number we need to remember is “23”.

Getting Category id

After you have gotten your categories ID number, you will next need to change your index.php file.  In your index.php file look for the line with “have_post” and add the below code after.

<?php if (have_posts()) : ?>; Look for this line and add below
<?php query_posts('showposts=10&amp;;cat=23'); ?>;
<?php while (have_posts()) : the_post(); ?>;

Last, change “cat” to the category id from above. “showposts” is the number of posts to display on the page.

Displaying one category on your WordPress main page

If you would like to only display a single category on your WordPress main page, here’s how you do it. You will need to start out by getting ID of the category you wish to display.   In WordPress 2.7+,  start out by going to your categories tab under posts(1), then hover over the category you would like to display in your post(2), don’t click on it, just hover over it.  On the bottom of your screen, you will be shown then URL of the category your hover over(3), remember the ID number that being displayed.   In the below example the number we need to remember is “23”.

Getting Category id

After you have gotten your categories ID number, you will next need to change your index.php file.  In your index.php file look for the line with “have_post” and add the below code after.

<?php if (have_posts()) : ?> //Look for this line and add below
<?php query_posts('showposts=10&;cat=23'); ?>
<?php while (have_posts()) : the_post(); ?>

Last, change “cat” to the category id from above. “showposts” is the number of posts to display on the page.

wp-Gallery2 Image Block post

The wp-Gallery2 Image Block plugin will allow you to put one of the many Gallery2 Image Blocks on your WordPress site.  You are required to have a running Gallery2 install to use this plugin.

This is a complete rewrite of Chris Schierer (aka Lentil) Gallery2 Image Block Plugin 0.1.4.  This rewrite uses the new WordPress 2.8 Widget API, so is only compatible with WordPress 2.8+.

All options described in the Gallery 2 Image Block documentation are included.

User configuration of Image Block options is available through the Widget configuration panel.  Blank (empty) options use the Gallery2 defaults.

Note: The widget is written using lib_curl() to avoid url_fopen issues.

Download

  • wp-gallery2-image-block – Version 0.4 (2009-July-16)
  • wp-gallery2-image-block – Version 0.3 (2009-July-15)
  • wp-gallery2-image-block – Version 0.1 (2009-July-12)

Screen Shots

Installation

Extract the zip file and copy the folder wp=gallery2-image-block into your wp-content/plugins/ directory of your WordPress installation and then activate the Plugin from Plugins page.