Wordpress Tips:Useful Conditional Tags in Wordpress

April 26th, 2009 No Comments   Posted in Wordpress Tips

Toady’s Wordpress Tip is about Conditional Tags.

Today when I tried to add adsense advertising unit in my blog lanceblog.net. So I added my adsense code into sidebar.php of my theme.

But I realized to that I just wanted the commericials to be displayed on the side bar of  a single page, exluding index page.

Okay, here comes the solution. In wordpress, there are lots of  Conditional Tags.

To solve my problem, I shoudl use this Conditional Tags: is_single() to decide whether the page displaying is a single page or the index page.

Then I found there are lots of useful Conditional Tags. I just name a few.

is_home()
When the main blog page is being displayed.
is_admin()
When the Dashboard or the administration panels are being displayed.
is_category()
When any Category archive page is being displayed.
is_single()
When any single Post page is being displayed.
is_404()
When a page displays after an “HTTP 404: Not Found” error occurs.
is_archive()
When any type of Archive page is being displayed. Category, Author and Date based pages are all types of Archives.

For more, just go to Wordpress Codex.

Wordpress Tips: A Wired Thing of Wordpress:If 777 is not working.

January 20th, 2009 No Comments   Posted in Wordpress Tips

Here’s another Wordpress tip that I found myself.

Yeah,it’s a wired thing if you have changed your uploads folder to “777″ and it’s still not working!

Try this,at least  it helped me out. Try to look the default setting of your upload folder. It’s in Settings->Misc.

If  your defaultsetting  is not  “Wordpress default”-wp-content/uploads (mine is a physical path thing like /mnt/local/home….), try to apply the “Wordpress default”-wp-content/uploads  and it should work it out.

That’s today’s Wordpress Tip!

Wordspress Plugins:How to run code in your wordpress

January 19th, 2009 Comments Off Posted in Wordpress Tips

Here’s another useful Wordpress Plugin!  You could run code in your Wordpress posts by using this plugin. The plugin is here : http://wordpress.org/extend/plugins/runcode/

Usage:

<runcode>
<script>
window.alert(”Hello world!”);
</script>
<p>You can change the code before run.</p>
</runcode>
<runcode>……</runcode> Put your code between these two tags.
Okay, this is today’s Wordpress Plugin!

Wordpress Tips: Use Google Gears to Power Up Your Wordpress

December 14th, 2008 No Comments   Posted in Wordpress Tips

Today’s Wordpress Tips is about Google Gears.

I am so ashamed that I didn’t turn on Google Gears options in Wordpress.

What does Google Gears do? It stores the data of a given website on your hard drive, So the next time you visit the same site, it could help you speed up the loading of the page.

If you want to turn on this Wordpress feature. Simply goto “Tools” -”Gears”.

Enjoy the speed!

Wordpress Tips:Add a Favicon to Your Wordpress Blog

November 16th, 2008 No Comments   Posted in Wordpress Tips

Today I found another Wordpress Tips: Add a favicon!

Notice the left corner of your address bar? See those cute favicons? How about your wordpress blog? Blank? Create one for blog!

Step 1:Simply go to this website to create a favicon .ico file use your own pictures or photos.

http://www.html-kit.com/favicon/

Step 2: Then upload the favicon file to your website. e.g your theme folder …/images.

Step 3.: Add these code lines into header.php of your theme.

<link rel="shortcut icon" type="image/ico" href="<?php bloginfo('stylesheet_directory'); ?>/images/favicon.ico" />

Step 4: Delete your browser cache and load your Wordpress blog~

Enjoy your new Favicon!

Wordpress Plugins:Yet Another Related Posts

November 15th, 2008 No Comments   Posted in Wordpress Tips

Today’s Wordpress Plugin is about Related Posts.

A few days ago, I found few people asking question one of my post, but the answer to their question is just in my another post. So I want a Related Post Plugin. Then I found this great plugin :Yet Another Related Posts

It will match every post of your automaticlly and determine the relationship between your posts based on index ranging from 0-10.

10 means most likley related. That’s pretty cool!

Try Search it! Yet Another Related Posts

Wordpress Plugins:Post Video in Your Wordpress

September 11th, 2008 No Comments   Posted in Wordpress Tips

Today’s Wordpress Plugin is about Video.

Yesterday when I tried to insert a Youtube Video. I was frustrated. Because all Wordpress could do is displaying a link of that video in the post.

Okay, then I put the Embed Script in, and it’s done. Wonder why this happened. Wordpress Dev team should thought about it.

PS: if you want your video to be centered. Just place <center></center>and the beginning and end of the Embed Script.


Wordpress Plugins:Change Wordpress Post Category in Batch

September 8th, 2008 No Comments   Posted in Web Design Tutorials, Wordpress Tips

Today, Lance found an interesting Wordpress Plugin, Batch Category.When I moved to my blog  www.lanceblog.net,

I exported my post entries and imported into my current blog. But all my imported posts in one category “Uncategorized”.  And I just could not edit those post one by one. It pains to so that. So I found this useful plugin. Bath Category. It helped me to move any number of posts into one category at one time. This is amazing. You guys should  bookmark it. It could come in handy someday.

Download this Plugin:http://robm.me.uk/projects/plugins/wordpress/batch-categories/

Wordpress Tips:Image Stick Out of Page?

September 2nd, 2008 No Comments   Posted in Wordpress Tips

Lance’s Wordpress Tip today is about images.

If you post any image that stick out your theme border. The following are the possible solutions

1. CSS

#xxxx .xxxxx img {
max-width: 450px;
width: expression(this.width > 450 ? “450px” : this.width);
}

max-width: 450px: are for Firefox and Opera. If you are using IE add this to the code.
width: expression(this.width > 450 ? “450px” : this.width);

2. Define the Width

You could define the width of the image manually to the width of your page, thus it won’t stip out of the page again.