Stupid WordPress Tricks

Accessing WordPress $post variable data:

http://www.velvetblues.com/web-development-blog/wordpress-post-variable-reference/

Add this to functions.php to remove white space from around the_title() tag:

add_filter(‘wp_title’, create_function(‘$a, $b’,’return str_replace(” $b “,”",$a);’), 10, 2);

I use the following combination of tag generation code for this blog, I prefer it over any SEO plugins and it works well:

<? if(is_home()):?>
<?=get_bloginfo(“name”);?> | <?=get_bloginfo( “description” );?>
<? elseif(is_front_page()):?>
<?=get_bloginfo(“name”);?> | <?=get_bloginfo( “description” );?>
<? else: ?>
<?php wp_title(”); ?> | <?=get_bloginfo( ‘name’ );?>
<? endif;?>


” />

” />

 | ” />


,internet consultant,internet consultant in china,china it professional,it support in china” />

,internet consultant,internet consultant in china,china it professional,it support in china” />

,,internet consultant,internet consultant in china,china it professional,it support in china” />

Re-organize all posts if set by date (MySQL):

update wp_posts
set post_date = str_to_date(
concat(
floor(1 + rand() * (12-1)), /* Generate a random month */
‘-’,
floor(1 + rand() * (26 -1)), /* Generate a random day */
‘-’,
’2009′
),
‘%m-%d-%Y’
);

Share on twitter
Twitter
Share on reddit
Reddit
Share on telegram
Telegram
Share on email
Email
Share on print
Print

Site made with love of these open source tools

The beautifully-crafted OS that forces you to learn how to do things properly.

For better or worse, WordPress powers 30% of the web. ClassicPress reduces some of the bloat.

Text is my material. Learn one text editor well.

Version controlling all the things.

Retaining workspaces on local and remote servers.

Supporting the OpenBSD community with opinionated VMs. €10/yr donated to the OpenBSD Foundation.

To Roman Zolotarev, for helping us Master the Web. My family and friends for enduring my voluntary financial hardship while pursuing my passions.