background preloader

Tips & Tricks

Facebook Twitter

Stupid WordPress Tricks. One of the most popular articles here at Perishable Press is my January 2005 post, Stupid htaccess Tricks.

Stupid WordPress Tricks

In that article, I bring together an extensive collection of awesome copy-&-paste HTAccess code snippets. Four years later, people continue to tell me how much they enjoy and use the content as a bookmarked reference for many of their HTAccess needs. The article was even published in a book on Joomla! Security. This is very inspiring to me, so I have decided to create a similar post for all of the useful WordPress code snippets, tips and tricks that I have collected while working on Digging into WordPress, the new book by co-author Chris Coyier and myself that really “digs in” to all of the awesome ways to get the most out of WordPress. If you are one of the millions of people who use WordPress, this article will help you improve the appearance, functionality, and performance of your WordPress-powered websites.

Table of Contents. Display latest comments in WordPress sidebar. This code snippet demonstrates how to display a certain number of latest comments in your WordPress sidebar and wherever your you like a list a recent comments to be displayed.

Display latest comments in WordPress sidebar

Maybe the footer. Display latest comments in WordPress sidebar Many WordPress themes come with the ability to display your most recent comments somewhere in the sidebar. This may be by using a built-in WordPress widget. If your theme does not contain this functionality then follow this tutorial to be able to manually place your most recent comments in the sidebar of your theme. To implement this functionality we first need to navigate to our theme directory. Copy the below functions and add it to your current active themes functions.php file Change the ‘$posts = 5‘ to the number of posts you wish to display. Add the below line of code in your theme file where you want the recent comments displayed. What this code snippet will do is display the latest 5 comments trunicating the comments at 25 characters. How to hack recent comments default widget? In list with recent coments - only show one comment per page/post (latest comment)

10 Must Have WordPress Plugins of 2013 Every Blogger Should Know About. How many of you think that having a lot of WordPress plugins slows down your site?

10 Must Have WordPress Plugins of 2013 Every Blogger Should Know About

That’s only true if you use poorly coded WordPress plugins. With over 26,000+ WordPress plugins in the repository, it’s hard for bloggers to pick the right WordPress plugin. I own and mange the largest free WordPress resource site WPBeginner, so I get to test and review tons of free and paid plugins on a regular basis. The site runs over 40 plugins, and it is very fast. Myth Debunked…”Plugin quantity doesn’t matter” In this article, I will share the 10 must have WordPress plugins of 2013 that every blogger should know about. #1. Most social media plugins for WordPress are slow and bloated. Floating Social Bar is easy to use with its drag-drop interface, and its eye-catching floating display allows you to maximize your social shares. #2.

Yoast’s WordPress SEO is the most comprehensive SEO plugin for WordPress. Each of the above are a must have for every site. . #3. . #4. . #5. . #6. . #7. . #8. . #9. . #10. Function Reference/wp register script. Function Reference/wp register script Languages : English • 한국어 • ( Add your language ) Description Registers a script file in WordPress to be linked to a page later using the wp_enqueue_script() function, which safely handles the script dependencies.

Function Reference/wp register script

Usage <? Parameters $handle ( string ) ( required ) Name of the script. Default: None $src ( string ) ( required ) URL to the script, e.g. . $deps ( array ) ( optional ) Array of the handles of all the registered scripts that this script depends on, that is the scripts that must be loaded before this script. Default: array() Theme development - When to use add_action('init') vs add_action('wp_enqueue_scripts') [tuto]Intégrer le moteur de recherche Google à Wordpress. Ce tuto vous présente une méthode pour remplacer le moteur de recherche intégré à WordPress par le moteur Google appelé aussi CSE (Custom Search Engine) sans plugin et sans iframe.

[tuto]Intégrer le moteur de recherche Google à Wordpress

Pourquoi changer ? Nous en avions déjà parlé il y a 2 ans, le moteur de recherche intégré à WordPress n’est pas forcément d’une grande efficacité. A l’époque, j’avais pallié à ce constat en installant un plugin supplémentaire (Search Everything). En effet, WordPress se base particulièrement sur les mots clefs pour effectuer ses recherches, mais quand on arrive à plusieurs centaines d’articles et que l’on suit une ligne éditoriale bien définie, ces mots clefs se retrouvent dans plusieurs dizaines d’articles et la recherche devient de moins en moins efficace. Modifier simplement et efficacement la recherche de WordPress. SEO by Yoast. WordPress out of the box is already technically quite a good platform for SEO, this was true when I wrote my original WordPress SEO article in 2008 (and updated every few months) and it's still true today, but that doesn't mean you can't improve it further!

SEO by Yoast

This plugin is written from the ground up by Joost de Valk and his team at Yoast to improve your site's SEO on all needed aspects. While this WordPress SEO plugin goes the extra mile to take care of all the technical optimization, more on that below, it first and foremost helps you write better content. WordPress SEO Tutorial. By Joost de Valk — Last update September 8th, 2014 The Definitive Guide To Higher Rankings For WordPress Sites WordPress is one of the best, if not the best content management systems when it comes to SEO. Search Engine Optimization Plugin. Optimize for keywords, keyphrases, synonyms, related keywords, and all word forms of those In Yoast SEO you can enter the keyword or keyphrase you’d like your post or page to rank for in the search results.

We then run a check on your content to check whether you’re using the keywords often enough – but not too often – and in the right spots. In Yoast SEO Premium, we take this one major step further. We will not only check for the keyword or keyphrase you enter, but we will analyze your text on all variations of that word or phrase. If the keyphrase is “room decorating ideas” and the synonym is “apartment decorating ideas” all the possible word forms of each word are taken into account: ‘apartments’, ‘rooms’, ‘room’s’, ‘decorate’, ‘decorates’, ‘decorated’, ‘idea’, etc. Optimize for related keywords as well [Premium] In the free version, you can only set 1 focus keyword or keyphrase. Function Reference/register post type. Function Reference/register post type Languages: English • 中文(简体) • 日本語 • (Add your language) Description Create or modify a post type. register_post_type should only be invoked through the 'init' action.

Function Reference/register post type

It won't work at all if called before 'init', and aspects of the new post type will work incorrectly if called later. Taxonomies When registering a post type, always register your taxonomies using the taxonomies argument.