How To Have Your WordPress Website Move From Local To Remote Procedures
The following snippet will let you have your WordPress website move from local to remote procedures.
1 2 3 4 5 |
UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://localhost:8888/', 'http://www.new-domain.com'); UPDATE wp_posts SET post_excerpt = REPLACE(post_excerpt, 'http://localhost:8888/', 'http://www.new-domain.com'); UPDATE wp_posts SET guid = REPLACE(guid, 'http://localhost:8888/','http://www.new-domain.com'); UPDATE wp_options SET option_value = REPLACE(option_value, 'http://localhost:8888/', 'http://new-domain.com/'); UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'http://localhost:8888/', 'http://new-domain.com/'); |
How To Load Content Externally In WordPress
The following snippet will let you load content externally in WordPress.
1 |
require($_SERVER['DOCUMENT_ROOT'].'/wp-load.php' ); |
Snippet Source/Credit: Snipplr
How To Manually load Google’s Latest jQuery In WordPress
Using the following snippet below, you will be able to manually load Google’s latest jQuery in WordPress.
1 2 3 |
<?php wp_deregister_script('jquery'); ?> <?php wp_head(); ?> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> |
Snippet Source/Credit: encosia.com
How To Organize WordPress Category Archive Listing By Subcategory
The following snippet below will let you organize WordPress archive listings by subcategory.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
<?php $categories = get_categories("child_of=17"); foreach ($categories as $cat) { ?> <div class="genre_subcat"> <?php query_posts("cat=$cat->cat_ID&showposts=-1&order=ASC&orderby=name"); ?> <h2><?php single_cat_title(); ?></h2> <small><?php echo category_description($cat->cat_ID); ?></small> <?php while (have_posts()) : the_post(); ?> <div class="post"> <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3> <p class="postdate"><?php the_time('F jS, Y') ?></p> <?php the_content(); ?> <p class="postmetadata">Posted in <?php the_category(', ') ?> | <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></p> </div> <?php endwhile; ?> </div> <?php }?> |
Snippet Source/Credit: iamnotagoodartist.com
How To Prevent WordPress Stylesheet From Being Cached
We often are in the condition in which we are looking out for the ways by which we can prevent WordPress stylesheet from being cached. To help you out with the same, the following snippet below will let you achieve the same.
1 |
<link rel="stylesheet" href="<?php $theme_data = get_theme_data(TEMPLATEPATH . '/style.css'); bloginfo('stylesheet_url'); echo '?' . $theme_data['Version']; ?>" type="text/css" media="screen, projection" /> |
Snippet Source/Credit: WPRecipes.com