Category 'WordPress'


WordPress Snippet: src thumbnail

WordPress allows you to associate a thumbnail to a post , page or post customized. , che restituiscono il completo tag img , risulta meno intuitivo come ottenere il solo link: If it is easy to extract the entire image code, thanks to features the_post_thumbnail() or get_the_post_thumbnail , which return the complete tag img , less intuitive is how to get the single link:

1
2
3
4
/ / If $ post_id is the id of the post
get_post_thumbnail_id ( $post_id ) ; $ Image_id = get_post_thumbnail_id ($ post_id);
wp_get_attachment_image_src ( $image_id , 'full' ) ; $ Image = wp_get_attachment_image_src ($ image_id, 'full');
[ 0 ] echo $ image [0]

Continued ...

WordPress Delete Post

WordPress allows you to intercept when a post - even custom type - is being eliminated. . There are two action hooks that can be used: delete_post and deleted_post . In the first analysis, the former should be attributed to a "is being eliminated" the post, even if it does not seem to be, or better.

Continued ...

Very short snippet: set the log files on WordPress

si attivano i log a video prodotti da PHP, riempiendo lo schermo di Notice, Warning e quant'altro. By setting the file wp-config.php define the define('WP_DEBUG', true); logs are activated by PHP-screen products, filling the screen, Notice, Warning, and more. If controls for "flying" this can be useful in situations of exercise is highly recommended, for obvious reasons. Luckily, WordPress allows her to "convey" these logs to a file, which by default is placed in /wp-content/debug.log .

Continued ...

WordPress shortcode Table

Let me demonstrate how to use the shortcode - indented (nested) - WordPress to create tables to insert into posts and pages. For example, I will show you how to create comparative charts, those used to compare the particularities of applications or products, such as:

Continued ...

WordPress Snippet: Remove the admin bar

The latest version of WordPress has added a new toolbar frontend side when the administrator is logged. If you want to disable this code included in the file functions.php of your theme:

1
2
3
4
/ / Check to see if the filter show_admin_bar
has_filter ( 'show_admin_bar' ) ) { if (has_filter ('show_admin_bar')) {
, '__return_false' ) ; add_filter ('show_admin_bar', '__return_false');
}

Continued ...

WordPress: retrieve the contents of private pages

Allocation from the post WordPress: retrieve the contents of a page to add some information. First of all, you can retrieve the contents of a page using a function like this:

1
2
3
4
$slug ) { getPageBySlug function ($ slug) {
get_page_by_path ( $slug ) ; ObjectPost get_page_by_path = $ ($ slug);
"the_content" , $objectPost -> post_content ) ; return apply_filters ('the_content', $ objectPost -> post_content);
}

Continued ...

WP 2.7 Bannerize

New major upgrade to WP Bannerize , now in release 2.7. Excluding any bug fixes, I think this will be the last release that will make in 2010! We define an early Christmas present. This latest version introduces a lot of requests (such as impressions or scheduling by date) reported by users and the full list you can read it in detail here .

Continued ...

bbPress: wrong forum search

The form presented after a search in bbPress allows to refine the results indicating the forum at which to search. The combo with the list of forums, unfortunately, has a "gross" error at the kernel level. invece del corretto forum_id . The tag select , in fact, is appointed by forum-id instead of the correct forum_id . This issue has already been reported on the development team! Nine months ago.

Continued ...

Very short trick: WordPress, customize the Meta Box thumbnail

In reference to this Comment : The Metabox thumbnails usually has the title set to "image evidence".

Continued ...

Very short snippet: get the number of posts, Page and Attachment

How many of you know, the table wp_posts is used to store the WordPress post, pages and attachments. The type of the item stored is determined by the field post_type . . With select proposed below, you can "count" individually the various types of elements in memrizzate wp_posts .

Continued ...