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


DISPLAY POST THUMBNAIL ALSO IN EDIT POST AND PAGE OVERVIEW

WordPress chronicle 2.9 introduced a duty of Post Thumbnail. We wrote about this underline in this post as well as here as well as additionally in most alternative blogs. we find it an advantage, if a general outlook of articles as well as pages additionally provides a compared thumbnail. Therefore, we would similar to to deliver a tiny formula dash which creates only that.

post-thumbnail-edit Display Post Thumbnail Also In Edit Post and Page Overview

The on top of screenshot should spell out what a small prolongation does. The following formula contingency be put in a Plugin or be copied in to a functions.php of a theme.

if ( !function_exists('fb_AddThumbColumn') && function_exists('add_theme_support') ) {
 
	// for post as well as page
	add_theme_support('post-thumbnails', array( 'post', 'page' ) );
 
	function fb_AddThumbColumn($cols) {
 
		$cols['thumbnail'] = __('Thumbnail');
 
		return $cols;
	}
 
	function fb_AddThumbValue($column_name, $post_id) {
 
			$width = (int) 35;
			$height = (int) 35;
 
			if ( 'thumbnail' == $column_name ) {
				// thumbnail of WP 2.9
				$thumbnail_id = get_post_meta( $post_id, '_thumbnail_id', true );
				// picture from gallery
				$attachments = get_children( array('post_parent' => $post_id, 'post_type' => 'attachment', 'post_mime_type' => 'image') );
				if ($thumbnail_id)
					$thumb = wp_get_attachment_image( $thumbnail_id, array($width, $height), true );
				elseif ($attachments) {
					foreach ( $attachments as $attachment_id => $attachment ) {
						$thumb = wp_get_attachment_image( $attachment_id, array($width, $height), true );
					}
				}
					if ( isset($thumb) && $thumb ) {
						echo $thumb;
					} else {
						echo __('None');
					}
			}
	}
 
	// for posts
	add_filter( 'manage_posts_columns', 'fb_AddThumbColumn' );
	add_action( 'manage_posts_custom_column', 'fb_AddThumbValue', 10, 2 );
 
	// for pages
	add_filter( 'manage_pages_columns', 'fb_AddThumbColumn' );
	add_action( 'manage_pages_custom_column', 'fb_AddThumbValue', 10, 2 );
}

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)

Read a original: 
Display Post Thumbnail Also In Edit Post as well as Page Overview


Get Auto Caffeinated Content for Your WordPress Blog



WORDPRESS WIDGET-AREAS WITH DESCRIPTION

WordPress-Christmas-23 WordPress Widget-Areas with DescriptionUsing WordPress chronicle 2.9, there is right away a probability that you can write some-more minute outline for a widget areas. This is generally engaging when you conclude opposite widget areas, depending of categories or since a thesis writer defines assorted widget areas, that allows adjustments in some-more areas than only a sidebar. you do this for e.g. in a thesis Greyfoto, where a footer area is additionally versed with widgets.

In a following e.g. formula you conclude a widget area, called My Lorem Ipsum Sidebar, that contains „detailed“ information.

if ( function_exists('register_sidebar') ) {
    register_sidebar(array(
        'name' => 'My Lorem Ipsum Sidebar',
        'description' => __('Sed ut perspiciatis unde omnis iste natus blunder lay voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et almost architecto beatae vitae dicta sunt explicabo.', 'your_textdomain'),
        'before_widget' => '<li id="%1$s" class="widget %2$s">',
        'after_widget' => '</li>',
        'before_title' => '<h2 class="widgettitle">',
        'after_title' => '</h2>',
    ));
}

wp-widgets WordPress Widget-Areas with Description

A some-more extensive e.g. with dual widget areas, a single area for a sidebar as well as an area for a footer.

if ( function_exists('register_sidebar') ) {
    register_sidebar(array(
        'id' => 'sidebar',
        'name' => 'My Lorem Ipsum Sidebar',
        'description' => __('Sed ut perspiciatis unde omnis iste natus blunder lay voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et almost architecto beatae vitae dicta sunt explicabo.', 'your_textdomain'),
        'before_widget' => '<li id="%1$s" class="widget %2$s">',
        'after_widget' => '</li>',
        'before_title' => '<h2 class="widgettitle">',
        'after_title' => '</h2>',
    ));
 
    register_sidebar(array(
        'id' => 'footer',
        'name' => 'My Lorem Ipsum Footer',
        'description' => __('Sed ut perspiciatis unde omnis iste natus blunder lay voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et almost architecto beatae vitae dicta sunt explicabo.', 'your_textdomain'),
        'before_widget' => '<li id="%1$s" class="widget %2$s">',
        'after_widget' => '</li>',
        'before_title' => '<h2 class="widgettitle">',
        'after_title' => '</h2>',
    ));
}

This might be used as follows in a templates, it’s being used in a footer.php of a widget area My Lorem Ipsum Footer.

<div id="footer">
    <ul>
        <?php dynamic_sidebar('footer'); ?>
    </ul>
</div>

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)

See some-more here:
WordPress Widget-Areas with Description


Get Auto Caffeinated Content for Your WordPress Blog



THE ULTIMATIVE GUIDE FOR THE_POST_THUMBNAIL IN WORDPRESS 2.9

WordPress-Christmas-18 The Ultimative Guide For the_post_thumbnail In WordPress 2.9WordPress 2.9 RC1 is expelled as well as a code new post thumbnail duty will not shift until a final chronicle hopefully.
I was chatting a small bit with Sergej Müller final night as well as you were perplexing a little things out. We found out a following things:

You can yield 4 design formats to a function:

// a thumbnail
the_post_thumbnail('thumbnail');
 
// middle resolution
the_post_thumbnail('medium');
 
// vast resolution
the_post_thumbnail('large');
 
// original
the_post_thumbnail();

You can set how a images should align. It is additionally probable to allot an own class:

//  left align
the_post_thumbnail('thumbnail', array('class' => 'alignleft'));
 
//  right align
the_post_thumbnail('thumbnail', array('class' => 'alignright'));
 
//  center
the_post_thumbnail('thumbnail', array('class' => 'aligncenter'));
 
// enter into right as well as a category  'my_own_class'
the_post_thumbnail('thumbnail', array('class' => 'alignright my_own_class'));

The 3rd probability is a carry out of a images distance with an form of tallness as well as width:
For this role you suspect which a settings for thumbnail is 150×150, for middle 300×200 as well as for vast 600×400.

// thumbnail scaled to 60x60 pixel
the_post_thumbnail(array(60,60), array('class' => 'alignleft'));
 
// strange thumbnail
the_post_thumbnail(array(150,150), array('class' => 'alignleft'));
 
// middle fortitude scaled to 200x133 pixel
the_post_thumbnail(array(200,200), array('class' => 'alignleft'));
 
// vast fortitude scaled to 400x266 Pixel
the_post_thumbnail(array(400,345), array('class' => 'alignleft'));

We see which a picture proportions have been regularly maintained, even if a single specifies curved values.

For a Theme Designers is this not indispensably easier, since no a single knows what a user will put in his settings o his library. One proceed to proceed this problem, to question a options for a assorted sizes:

// breadth of a thumbnails
get_option('thumbnail_size_w');
 
//  tallness of a thumbnails
get_option('thumbnail_size_h');
 
//  tallness of a middle resolution
get_option('medium_size_h');
 
//  breadth of a vast resolution
get_option('large_size_w');
 
//  1 = Crop thumbnail to expect dimensions, 0 = Crop off
get_option('thumbnail_crop')

You can shift these values in your theme.

$w = get_option('thumbnail_size_w') / 2;
$h = get_option('thumbnail_size_h') /2;
 
the_post_thumbnail(array($w, $h), array('class' => 'alignleft'));

Here an additional example: If a distance of a thumbnail is bigger than 100×100 as well as stand is activated, afterwards a thumbnail should be resized to 100×100, differently make use of a strange thumbnail.

if(get_option('thumbnail_size_w') > 100 && get_option('thumbnail_crop') == 1) {
    the_post_thumbnail(array(100,100));
}else{
    the_post_thumbnail('thumbnail');
}

Have fun with post thumbnails! But be aware, which any post thumbnail requires 2 interpretation bottom queries. On a page with 10 posts which would be twenty some-more queries.


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)

Original post:
The Ultimative Guide For the_post_thumbnail In WordPress 2.9


Get Auto Caffeinated Content for Your WordPress Blog



MANAGE MULTIPLE EXCERPT LENGTHS

WordPress-Christmas-10 Manage Multiple Excerpt LengthsBehind a 10th doorway of a Advent Calendar, you have a tip how to make use of mixed mention lengths. WordPress 2.9 allows you around filter to regulate excerpt some-more string as well as a length of a excerpt. But if you need multiform mention lengths for opposite templates, afterwards what?

Suppose you even need an mention of thirty words, as well as once with 45 difference as well as “…” as some-more string.
First, you write a filter functions with a compulsory values.

function wpe_excerptlength_teaser($length) {
    return 45;
}
function wpe_excerptlength_index($length) {
    return 30;
}
function wpe_excerptmore($more) {
    return '...';
}

Now a code brand code new mention function.

function wpe_excerpt($length_callback='', $more_callback='') {
    global $post;
    if(function_exists($length_callback)){
        add_filter('excerpt_length', $length_callback);
    }
    if(function_exists($more_callback)){
        add_filter('excerpt_more', $more_callback);
    }
    $output = get_the_excerpt();
    $output = apply_filters('wptexturize', $output);
    $output = apply_filters('convert_chars', $output);
    $output = '<p>'.$output.'</p>';
    echo $output;
}

This duty will be since a dual filter functions. It will inspect either those facilities have been accessible as well as if so, you practical a filter. Isn’t there a length function, afterwards WordPress relates a default worth of 55 words. Thereafter, a mention will be taken. Then one more filters have been practical (see default_filters.php). you haven’t used a filter convert_smilies, it doesn’t work with involuntary excerpts anyways as well as you privately do not similar to wpautop since it comes with indeterminate results, generally in lists or code. That’s because you wrapp a outputs with a clause.

Now you need a duty in a template.

<?php wpe_excerpt('wpe_excerptlength_index', 'wpe_excerptmore'); ?>
// a alternative one
<?php wpe_excerpt('wpe_excerptlength_teaser', 'wpe_excerptmore'); ?>

Now, it creates no clarity to write for any worth of 1-55, a filter duty ;) , though for 2-3 opposite values in opposite views, a resolution is useful.


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)

View strange post here:
Manage Multiple Excerpt Lengths


Get Auto Caffeinated Content for Your WordPress Blog



CONFIGURE WORDPRESS TRASH

WordPress-Christmas-07 Configure WordPress TrashCheck out a 7th doorway of a Advent Calendar.

WordPress Trash will have it’s premiere in chronicle 2.9. Now we can pierce each content, comment, post, pages, media as well as couple to trash. It’s utterly a same duty as we know from alternative online applications or handling systems.

If we similar to to configure a special date of how prolonged files should be kept in your trash, we can configure it in your wp-config.php.
define( 'EMPTY_TRASH_DAYS', 10 );

The default settings deletes your calm after thirty days. If we do not wish to make make use of of rabble at all, only make make use of of a worth 0.

define('EMPTY_TRASH_DAYS', 0);

Now there is no rabble in your admin area available, as well as additionally no links to pierce files to your trash.


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)

Read some-more here: 
Configure WordPress Trash


Get Auto Caffeinated Content for Your WordPress Blog



2ND DOOR OF OUR ADVENT CALENDAR – SUPPORT IN WORDPRESS FOR REL=”CANONICAL”

WordPress-Christmas-02 2nd Door Of Our Advent Calendar – Support in WordPress for rel=”canonical”
WordPress 2.9 will await a charge rel as well as his worth canonical, we can additionally review about it on an comparison post how to confederate a values as well as what’s about it. Therefore we do not have to pulp a HTML categorically in your theme.

In prior versions of WordPress 2.9, a intergration is easy to do:

<?php if ( is_singular() ) echo '<link rel="canonical" href="' . get_permalink() . '" />'; ?>

Putting it in a header.php of a thesis is a easiest approach to have a link-tag in a head of your frontend.

Since WordPress 2.9 it won’t be required since WordPress set with a assistance of a default filter, see wp-includes/default-filters.php, a link-tag to a offshoot wp_head.

add_action( 'wp_head', 'rel_canonical' );

Thereby it calls a duty rel_canonical(), that simply writes a HTML as well as passes a couple of a article. Alternatively we can invalidate a filter as well as we can make use of it yourself.

remove_action( 'wp_head', 'rel_canonical' ); // to undo in head

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)

More here: 
2nd Door Of Our Advent Calendar – Support in WordPress for rel=”canonical”


Get Auto Caffeinated Content for Your WordPress Blog



WORDPRESS DATABASE REPAIR SCRIPT IN 2.9

A small tip for all users of a existent beta of WordPress 2.9 as well as for all who instruct to refurbish shortly to a code new version. With chronicle 2.9 WordPress conducts a own slight to optimize a database. Previously it was finished by possibly Plugins or around SQL access. From a subsequent chronicle this duty is implemented in a core …

wprdb11-300x78 WordPress Database Repair Script In 2.9

… which we can turn on with a assistance of a constant; stored in wp-config.php, we have entrance to a script.

define('WP_ALLOW_REPAIR', true);

Call a book from a outward at a following residence …
http://example.com/wp-admin/maint/repair.php

… where we possibly correct a database or run a optimization. Technically, there is no sorcery at a back of this work, though a informed SQL statements ANALYZE TABLE, REPAIR TABLE as well as OPTIMIZE TABLE.

wprdb-300x127 WordPress Database Repair Script In 2.9

I theory which will begin a debate, because with a consistent as well as because from a outside, etc. – leave your criticism here. Alternatively, any one can minister to WordPress as well as plead without delay with a developers or come in changes without delay to a code.


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:
WordPress Database Repair Script In 2.9


Get Auto Caffeinated Content for Your WordPress Blog



WORDPRESS 2.9 ADD_THEME_SUPPORT AND HAS_POST_IMAGE

The brand brand new the_post_image functionality in WordPress chronicle 2.9 has been enhanced.
New is a wp-settings.php line

// Load in await for template functions that a thesis supports
require_if_theme_supports( 'post-thumbnails', ABSPATH . WPINC . '/post-image-template.php' );

In functions.php it queries either a thesis supports post-thumbnail function:

if ( function_exists( 'add_theme_support' ) )
	add_theme_support( 'post-thumbnails' );

If we demeanour at a record wp-includes/post-image-template.php, there have been 4 brand brand new features:

  • has_post_image()
  • get_post_image_id()
  • the_post_image()
  • get_the_post_image()

The thesis itself can check inside of a loop, if a post has a Post-Thumbnail, as well as if so, afterwards it can be output:

<?php if ( has_post_image() ) : ?>
	<a href="<?php the_permalink(); ?>"><?php the_post_image( array( 75, 75 ), array( 'class' => 'alignleft' ) ); ?></a>
<?php endif; ?>

Those meddlesome in some-more facilities as well as report should check a record in WordPress 2.9: wp-includes/post-image-template.php
Especially a function: get_the_post_image
Allows to regulate a outlay by regulating hooks.
In get_the_post_image a duty wp_get_attachment_image get additionally used, what has been explained in item in this post prior to perspective days.

Continued here: 
WordPress 2.9 add_theme_support as well as has_post_image


Get Auto Caffeinated Content for Your WordPress Blog



BATCH PLUGIN-UPDATE IN WORDPRESS 2.9

In a past we have already sensitive we a small bit about a brand new facilities of a arriving 2.9 chronicle of WordPress – a growth does not stop as well as a subsequent chronicle has most teenager changes. Improvements in security, administration.

WordPress 2.9 will have a probability to refurbish all your Plugins, that have an refurbish available, in a single step.
That creates upkeep work with customer’s as well as on your own blog some-more elementary as well as faster. As a small insight, here is a screenshot of a stream beta.

plugin-update-29-300x291 Batch Plugin-Update in WordPress 2.9

83a0fc99e8plugin-update-29-150x145 Batch Plugin-Update in WordPress 2.9

Original post:
Batch Plugin-Update in WordPress 2.9


Get Auto Caffeinated Content for Your WordPress Blog



NEW FEATURE IN WORDPRESS 2.9 – THE_POST_IMAGE()

In WordPress 2.9, there will be a capability to supplement an design to a post, as it’s been well known of repository themes. The design need not be insert in to a post. With a brand brand brand brand brand new underline the_post_image() we can make make use of of a brand brand brand brand brand new underline as well as to illustrate carry out where to display.

The dual screenshots uncover a brand brand brand brand brand new post thumbnail dialog when formulating a brand brand brand brand brand new article. Here we set a picture.

New Dialog Post Thumbnail

Post Thumbnail Dialog

In a template we can make make use of of a duty the_post_image() to place a image. Here’s an example:

<div class="entry">
    <?php the_post_image(); ?>
    <?php the_content('Read a rest of this entrance &raquo;'); ?>
</div>

You can additionally establish what fortitude we wish to display.

the_post_image(); // but parameter -> Thumbnail
the_post_image('thumbnail'); // Thumbnail
the_post_image('medium'); // Medium resolution

Unfortunately, a developers haven’t implemented a approach to enter into a design with a classes alignleft, alignright as well as aligncenter. And this is how it looks similar to with a default thesis of Wordpress:

Example of a brand brand brand brand brand new duty the_post_image

d3b385cb09post-thumbnail-small-150x37 New feature in WordPress 2.9 – the_post_image()

Original post:
New underline in WordPress 2.9 – the_post_image()


Get Auto Caffeinated Content for Your WordPress Blog

Pages