Make text bigger  Make text smaller  Toggle background color  Bookmark/Share


ADD CATEGORIES OR TAGS TO POST PROGRAMATICALLY

The initial thing to do is to emanate an form of categories id. Once done, we simply have to make use of a wp_set_object() function, that take 3 parameters: The post id, an form of categories to supplement to a post, as good as a taxonomy sort (category in this example). $category_ids = array(4, 5, 6); wp_set_object_terms( $post_id, $category_ids, ‘category’); Adding tags to a post is intensely easy as well.

Here is a original:
Add categories or tags to post programatically


Get Auto Caffeinated Content for Your WordPress Blog



SMALL TIPS USING WORDPRESS AND JQUERY

Inside of WordPress have been multiform of JavaScript libraries available, we can make make make make make make make make use of of of of of of of of them simply as well as we do not need an additional Theme or Plugins. Also, this is a endorsed proceed to capacitate libraries , so they won’t be installed some-more than once. Some records on these dual topics can be found in a essay Use JavaScript Libraries In And Of WordPress.

But from time to time we need something specific, so we have a small formula snippets for we in this post now. And we quite wish to uncover a small examples with jQuery. Many Themes as well as Plugins regulating jQuery as well as it is flattering easy to work with jQuery. In principle, these hooks as well as calls additionally request to your own scripts as well as alternative libraries.

The Hooks

WordPress provides Hooks to offshoot at certain points in to a core. This is a single of a strengths of WordPress as well as a following 3 Hooks have been in sold engaging to embody scripts in your Themes. The following examples spell out a small unsentimental use.

Replace jQuery of WordPress in your Theme with Google AJAX Library

In a following formula a jQuery-Library of Google CDN gets loaded; But we can still make make make make make make make make use of of of of of of of of jQuery though any problem. Other Plugins can entrance a living room really easy around wp_enqueue_script().

function fb_greyfoto_init() {
	if ( !is_admin() ) { // essentially not necessary, given a Hook usually get used in a Theme
		wp_deregister_script( 'jquery' ); // unregistered pass jQuery
		wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js', false, '1.4.2'); // register pass jQuery with URL of Google CDN
		wp_enqueue_script( 'jquery' ); // embody jQuery
	}
}
// nur for Themes given WordPress 3.0
add_action( 'after_setup_theme', 'fb_greyfoto_init' ); // Theme active, embody function

jQuery Library in footer

The default call of wp_enqueue_script( 'jquery' ) in your Theme takes care, which it uses jQuery of WordPress as well as if all Plugins as well as Themes have been setup correctly, a living room will be bucket usually once. But jQuery won’t get installed in your footer, instead in head of your site. That’s given we have to regulate a formula a small bit as well as supplement a parameter for “load in footer”.
Here have been dual examples prior to as well as after WordPress 3.0 given after_setup_theme is usually accessible given WordPress 3.0.

function fb_greyfoto_init() {
	if ( !is_admin() ) {
		wp_deregister_script( 'jquery' );
		wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js', false, '1.4.2', true ); // bucket in footer - true
		wp_enqueue_script( 'jquery' );
 
		// bucket js of Theme, requires jQuery
		wp_enqueue_script( 'styleswitcher', get_bloginfo( 'template_directory') . '/js/styleswitcher.jquery.php', array( 'jquery'), '1.3.2', true ); // bucket my book with pass styleswitcher in footer as well as make make make make make make make make use of of of of of of of of jQuery
		wp_enqueue_script( 'greyfoto', get_template_directory_uri() . '/js/photoblogfb.js', array( 'jquery', 'styleswitcher'), '1.1.3.1', true ); // make make make make make make make make use of of of of of of of of jQuery as well as styleswitcher as well as afterwards bucket book greyfoto
	}
}
 
// additionally for WP < chronicle 3.0
global $wp_version;
if ( version_compare($wp_version, "3.0alpha", "<") ) {
	add_action( 'init', 'fb_greyfoto_init' );
} else {
	add_action( 'after_setup_theme', 'fb_greyfoto_init' );
}

Load book for specific page

Sometimes we need a small scripts usually for a specific template, page or post – Therefore have been Conditional Tags. This probability improves a opening of your website. The following book will be installed usually for a template custom-page.php.

function fb_greyfoto_page_init() {
	if ( !is_page_template( 'custom-page.php' ) )
		return;
 
	wp_enqueue_script( 'mypagescript', get_template_directory_uri() . '/js/my_script_4_page.js', array('jquery'), '0.1', true );
}
add_action( 'template_redirect', 'fb_greyfoto_page_init' );

The make make make use of of of of $

Within scripts we have to cruise multiform things.
To work with $ , as most have been used to with jQuery, we have to broach jQuery to $ ; That’s an easy task, a reduced chronicle is $(function() {} ); , which should be used inside of WordPress.

jQuery(function ($) {
	// Now we can make make make make make make make make use of of of of of of of of $ as a anxiety to jQuery though any problem
});

To check either a HTML is loaded, make make make make make make make make use of of of of of of of of a following call. That creates certain which a DOM is installed as well as we can crop a DOM around jQuery as well as right away a genuine work of a book can start. we strongly suggest to make make make make make make make make use of of of of of of of of this variant. we do not wish to insist all a benefits, though we can review about it in a essay Introducing $(document).ready().

jQuery(document).ready(function ($) {
	$('#id').toggle({
		//parameter for e.g. toggle
	});
});

Related posts:


WP Engineer Favicon Thanks for subscribing a feed! Sponsor a WP Engineer Blog as well as get your code in front of multiform hundred users per day!
© WP Engineer Team, All rights indifferent (Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)

Excerpt from: 
Small Tips Using WordPress as well as jQuery


Get Auto Caffeinated Content for Your WordPress Blog



5 WAYS TO INCLUDE TEMPLATE FILES IN WORDPRESS

Separating a repeatitive formula in to a record is a great approach to classify as well as conduct code.

See a strange post: 
5 Ways To Include Template Files In WordPress


Get Auto Caffeinated Content for Your WordPress Blog



5 WAYS TO INCLUDE TEMPLATE FILES IN WORDPRESS

As prolonged as you work with WordPress, you’ll comprehend which a little formula is steady itself most times, similar to a loop. The brand new Twenty Ten thesis in WordPress 3.0 has put double back formula in in to a loop.php record to have it separated, as well as when it’s needed, only embody it in to thesis file. Why do not you follow that? Seperating a repeatitive formula in to a record is a great approach to classify as well as conduct code. It keeps a formula cleaner, simpler to read. All these files can be put in a stream thesis printed matter or subfolder to have a great structure. This is a really renouned element in program development: Don’t Repeat Yourself (DRY) or Duplication is Evil (DIE). In WordPress, there have been multiform ways to embody a template record in to stream file, which we’ll cruise in this article.

www.FeedBurner.com) 5 Ways To Include Template Files In WordPress 5 Ways To Include Template Files In WordPress

Go here to review a rest:
5 Ways To Include Template Files In WordPress


Get Auto Caffeinated Content for Your WordPress Blog



5 WAYS TO INCLUDE TEMPLATE FILES IN WORDPRESS

As prolonged as you work with WordPress, you’ll comprehend which a little formula is steady itself most times, similar to a loop. The brand new Twenty Ten thesis in WordPress 3.0 has put double back formula in in to a loop.php record to have it separated, as well as when it’s needed, only embody it in to thesis file. Why do not you follow that? Seperating a repeatitive formula in to a record is a great approach to classify as well as conduct code. It keeps the formula cleaner, simpler to read. All these files can be put in a stream thesis printed matter or subfolder to have a great structure. This is a really renouned element in program development: Don’t Repeat Yourself (DRY) or Duplication is Evil (DIE). In WordPress, there have been multiform ways to embody a template record in to stream file, which we’ll cruise in this article.

FeedBurner 5 Ways To Include Template Files In WordPress

View strange post here: 
5 Ways To Include Template Files In WordPress


Get Auto Caffeinated Content for Your WordPress Blog



ROUNDED TAG CLOUD WIDGET FOR WORDPRESS

If we have been regulating customary chronicle of WordPress tab clouded cover widget, we might feel tedious or be vexed a look-and-feel.

Read a strange here:
Rounded Tag Cloud Widget for WordPress


Get Auto Caffeinated Content for Your WordPress Blog



WP-PAGENAVI FOR LIGHTWORD

WP-PageNavi is a page navigation WordPress plugin. It can be used to reinstate a Previous posts as well as Next posts links from a home page, categories, tags, archives, as well as poke outcome pages. This plugin (WP-PageNavi-LightWord) adapts a strange WP-PageNavi, by becoming different a demeanour as well as feel to compare a demeanour as well as feel of important LightWord WordPress theme

See strange here: 
WP-PageNavi for LightWord


Get Auto Caffeinated Content for Your WordPress Blog



27 MORE CUSTOMIZATIONS FOR THE THESIS WORDPRESS THEME

Learn how to unequivocally have your Thesis-based WordPress site stone regulating these tutorials focusing on all from simple pattern as well as functionality to post sliders as well as amicable media integration.

FeedBurner 27 More Customizations for the Thesis WordPress Theme

Go here to review a rest:
27 More Customizations for a Thesis WordPress Theme


Get Auto Caffeinated Content for Your WordPress Blog



HOW TO: ADD GOOGLE RICH SNIPPETS TO WORDPRESS (WITHOUT EDITING YOUR THEME)

This guest post was created by John of WordPress Expert, where he provides WordPress tips, tutorials, news, plugins, as well as more. If we have WordPress believe as well as have been meddlesome in writing a post for WordPress Hacks, greatfully contact us.

When acid a web with Google, have we ever beheld which sure webpages with product reviews have a small star-rating as well as one some-more info which appears underneath a title?

For example…

Rich dash example

Notice a additions underneath a hyperlinked title. These eye-catching additions have been called “rich snippets.” Rich snippets give one some-more inflection to your examination pages when they crop up in poke formula as well as could assistance hoard one some-more poke engine trade for your site.

You can ask Google to uncover this arrange of interpretation for your examination posts by adding hReview formula to your WordPress blog. This routine has been lonesome in alternative tutorials before, though prior methods compulsory we to revise your theme’s formula as well as fiddle with law fields to get it to work. Not any some-more — here’s a easier, plugin-only method:

  1. Install a SEO Ultimate plugin. (You can download a zip record here or we can go to a SEO Ultimate homepage as well as come in your blog’s URL in a Auto Installer field.) Activate a plugin once it’s installed. SEO Ultimate has most alternative SEO facilities on top of abounding snippets, though if we usually wish to make use of a abounding dash functionality, we can invalidate all else underneath a “Modules” territory of a plugin’s “SEO” menu.
  2. In a WordPress administration department interface, find a post which you’d similar to to symbol as a examination as well as open it in a WordPress editor.
  3. In a “SEO Settings” box underneath a calm editor, name “Review” from a “Rich Snippet Type” dropdown. (If your post has a difficulty or tab called “Review” or “Reviews,” SEO Ultimate will pre-select a “Review” choice automatically.)
  4. If we gave a rating to a product we reviewed in your post, name a most-applicable star rating from a dropdown.
  5. Click “Save Changes” to save your post. All done! If we want, we can put your post URL by Google’s contrast tool to see a preview of your brand new abounding snippets.

SEO Settings box

Following these stairs will discuss it SEO Ultimate to supplement a hReview formula to your reviews. (Obviously, usually supplement a formula to posts in which we essentially examination something.)

Note which according to Google’s FAQ, adding a formula by itself won’t pledge which Google will uncover abounding snippets for your site. However, we can ask which Google arrangement abounding snippets for your site regulating this form. Even if Google doesn’t uncover your abounding snippets right away, carrying a formula on your site forward of time will assistance safeguard you’re forward of a diversion if/when Google rolls out abounding snippets on a wider scale.

Enjoy your abounding snippets!

 How To: Add Google Rich Snippets to WordPress (Without Editing Your Theme)

You have been celebration of a mass How To: Add Google Rich Snippets to WordPress (Without Editing Your Theme) © 2010 | WordPress Hacks | WordPress Directory | WordPress Forums | WordPress eBook

Enjoy essay about WordPress? Get your blog some-more bearing by fasten a WordPress Hacks essay team!

 How To: Add Google Rich Snippets to WordPress (Without Editing Your Theme)

Read some-more from a strange source: 
How To: Add Google Rich Snippets to WordPress (Without Editing Your Theme)


Get Auto Caffeinated Content for Your WordPress Blog



HOW TO PROGRAMATICALLY REMOVE WORDPRESS DASHBOARD WIDGETS

Simply pulp a following in to your functions.php file. The formula will mislay all dashboard widgets, so we should criticism lines associated to wigets you’d similar to to keep.

View post:
How to programatically mislay WordPress dashboard widgets


Get Auto Caffeinated Content for Your WordPress Blog

Pages