background preloader

Wordpress général

Facebook Twitter

Three Sexy Performance Rules for .htaccess on WordPress: Configure ETags, Gzip Compression, and Expires Headers | DQuinn.net. For those of us cheapskates on shared servers, our greatest weapon against the admonitions of YSlow is .htaccess, that innocuous text file that has the capacity to blow up your website if you mistreat it. To defeat rules #3: Add an Expires or Cache-Control Header, #4 GZip Components, and #13 Configure ETags, we need the following .htaccess swank (thanks to Matt Robertson for noticing that the rules I had here were not compressing CSS or JS): # MOD_DEFLATE COMPRESSION SetOutputFilter DEFLATE # 1-WEEK EXPIRES HEADER ExpiresActive On ExpiresDefault A0 ExpiresDefault A604800 Header append Cache-Control "public" # PUT YOUR WP SUPER CACHE RULES HERE # KILL THEM ETAGS FileETag none # YOUR WORDPRESS PRETTY PERMALINK RULES GO HERE GZip Compression In the above, I use mod_deflate compression because I’m hosted on MediaTemple, which doesn’t offer gzip compression.

If you don’t have the mod_deflate module on your shared space, you likely have mod_gzip enabled, so use that: Expires Headers ETags. Mikoder : wordpress. How To Include CSS and JavaScript. Updated: September 16th, 2012 Introduction In this tutorial, I am going to introduce a WordPress technique that I believe was unpublished until I raised the question a few days ago on the WordPress forums. In short, the problem I was trying to solve was plugins unnecessarily loading their JavaScript and CSS on *every* page of the blog, even when doing so would achieve absolutely nothing and the plugin wouldn't do any work.

Update #1: I have posted a follow-up in response to some comments received around the web. Update #2: There is a solution that can be considered a compromise as it works well for loading JavaScript but doesn't handle CSS. I briefly mentioned this approach here but but Scribu decided to expand on it by providing a nice Jedi-themed tutorial. Let me explain using this example: If you think about it, there are many plugins that only do something once in a blue moon. So what can we do to solve this? Loading CSS And JS In Place? What's This About wp_enqueue_FOO? The Solution. Désactiver les scripts et les styles des extensions ! sur Geekeries.fr | Découvrir WordPress. Disappearing Custom Post Data - Mikoder : Making a Difference Th.

Support » custom select query w/ pagination. First of all, thanks for the help aesqe - I've had to use it on 2 projects just since you posted this, its been a lifesaver. Im working on another project now where I need to use it - Im using a custom sort to sort by total votes from a post voting system - but I've run into a problem: The blog Im working on is a normal blog first and foremost - I only need to work with one category.

All is going fine, except that I want to set the page per post value to 5 - whereas it is 10 on the rest of the blog. Hardcoding $ppp seems to work great at first - but in practice, it gets a little trickier. When you hardcode $ppp, the proper number of posts are pulled, and everything paginates right. However, when you try to use the 'Previous posts' link to get to /page/2, if there are not enough posts (we'll say 7 posts) to qualify for a page 2 according to the default settings (in my case, 10), wordpress 404s the request. That seems a little confusing, so I'll try to reword it - the category has 7 posts. Post Thumbnail Images « Mark on WordPress. Many WordPress themes, especially those with “magazine-like” layouts, use an image to represent each post.

It might just be on the front page. It might be alone, or alongside an excerpt. Until now, there was no standardized way to do this. Many themes would require you to tediously enter a Custom Field with the value being the URL you wanted to use. Often you had to do cropping yourself. With WordPress 2.9, theme authors can easily enable Post Thumbnail selection UI and call those image using simple template tags. First, in the theme’s functions.php, declare that your theme supports this feature. That will enable Post Thumbnail UI for both Post and Page content types. Simply remove the one you don’t want to support. Next, you should specify the dimensions of your post thumbnails.

Your second option is hard-cropping. Now, you can make use of the template functions to display these images in the theme. The_post_thumbnail() outputs the Post Thumbnail, if it exists (in the loop): That’s it! Add Custom Column To WordPress Post Manage Page - Deluxe Blog Ti. The post manage page in WordPress shows you a list of posts with their details: title, author, categories, etc. These details give blog manager a quick summary view of the posts. Sometimes, you might want to add new custom column to this page, such as ‘Views’, ‘Ratings’ to see more statistics about posts, especially when you have installed the corresponding plugins.

This article will show you how to do that. Suppose that we’re going to add a custom column ‘Views’ into post manage page. In this article, I use the WP-PostViews plugin. This plugin adds a custom field into posts for storing number of views. Register custom column First, we need to register a custom column to WordPress. Add_filter('manage_posts_columns', 'my_columns');function my_columns($columns) { $columns['views'] = 'Views'; return $columns;} The function my_columns take an argument $columns which is an array of all registered columns.

Show the new column The hooked function takes one argument – name of the column.