All Questions
168
votes
108answers
59k views
Best Collection of Code for your functions.php file [closed]
Please vote on the question and any answers you find useful by clicking on the UP arrow on the left hand side of the question or answer.
As with many others who are now viewing this post, I have been ...
145
votes
3answers
37k views
When should you use WP_Query vs query_posts() vs get_posts()?
It seems like half the tutorials in the codex and around the blogosphere use query_posts() and half use WP_Query. What's the deal?
94
votes
19answers
20k views
How to: Easily Move a WordPress Install from Development to Production?
I do development on one box and use a second for production. Right now I just dump the database and then do a find a replace for the URL changes; then copy over the files and import the new SQL.
Are ...
78
votes
9answers
8k views
Tips for using WordPress as a CMS? [closed]
I want to use WordPress as a CMS for a reasonably basic site rather than a blog. I have several pages and at the moment, I don't intend to have a "news" page.
While there are ways to make this work, ...
73
votes
37answers
7k views
Objective Best Practices for Plugin Development? [closed]
Starting a community wiki to collect up objective best practices for plugin development. This question was inspired by @EAMann's comments on wp-hackers.
The idea is to collaborate on what objective ...
55
votes
12answers
6k views
Verifying that I have fully removed a WordPress hack?
My for-fun WordPress blog at http://fakeplasticrock.com (running WordPress 3.1.1) got hacked -- it was showing an <iframe> on every page like so:
<iframe ...
51
votes
7answers
12k views
Steps to Take to Hide the Fact a Site is Using WordPress?
I have a website for which we are trying to be discreet about the fact that we are using WordPress. What steps can we take to make it less obvious?
49
votes
11answers
8k views
WordPress frameworks and parent themes [closed]
By now there is a considerable amount of WordPress code around that is meant to be re-used by other developers. Unfortunately there is little to none practical and solid information on it and ...
47
votes
11answers
23k views
Adding a Taxonomy Filter to Admin List for a Custom Post Type?
I have created a Custom Post Type called 'listing' and added a Custom Taxonomy called 'businesses'. I would like to add a dropdown list of Businesses to the admin list for the Listings.
Here is what ...
47
votes
3answers
17k views
When to use WP_query(), query_posts() and pre_get_posts
I read @nacin's You don't know Query yesterday and was sent down a bit of a querying rabbit hole. Before yesterday, I was (wrongly) using query_posts() for all my querying needs. Now I'm a little bit ...
44
votes
27answers
6k views
Software for WordPress Theme and Plugin Development? [closed]
What software do you use for your WordPress related needs?
Please state your OS.
On windows XP I use:
filezilla (FTP)
notepad++ (for reading of PHP / CSS files)
firebug (a firefox extension to ...
42
votes
12answers
3k views
Steps to Optimize WordPress in Regard to Server Load?
Besides installing W3 Total Cache or another caching plugin what steps can I take to make sure that my theme and site run as fast as possible.
40
votes
10answers
16k views
Display a portion/ branch of the menu tree using wp_nav_menu()
I have a menu defined in WP Admin that looks like this:
I want to be able to display all the child links on the sidebar whenever I am at a parent page. For example, if the user is on my "About Us" ...
39
votes
7answers
3k views
Best collection of code for your .htaccess file [closed]
We have the Best Collection of Code for your functions.php file thread, so I thought that it might be useful to create a thread for our .htaccess files.
AND PLEASE REMEMBER TO ADD ANY OF YOUR OWN ...
39
votes
5answers
2k views
Updates for a private plugin?
If I write a private plugin, is there any way to use the WordPress auto-update mechanism to update it?
I want to encapsulate the functionality, but it's specific to my own 5 or so blogs, so it's not ...
37
votes
17answers
2k views
WPSE Plugin Repository: The plugins that came out of WP-Answers
Link your WPSE-Plugins
If you answered a question and made a plugin out of your code, than this is your place to share it.
The Idea:
An old comment from @MikeSchinkel during the beta phase where he ...
37
votes
8answers
3k views
Refactoring Wordpress to improve memory performance [closed]
I had a close look at Wordpress memory consumption. On my site, it seems that for each page hit 20MB of RAM gets allocated, just to prepare comfy environment for all the plugins to run in. I plotted ...
35
votes
8answers
7k views
Is moving wp-config outside the web root really beneficial?
One of the most common security best practices these days seems to be moving wp-config.php one directory higher than the vhost's document root. I've never really found a good explanation for that, but ...
32
votes
3answers
8k views
What is the preferred way to add custom javascript files to the site?
I've already added my scripts, but I wanted to know the preferred way.
I just put a <script> tag directly in the header.php of my template.
Is there a preferred method of inserting external or ...
32
votes
3answers
29k views
Menu items description? Custom Walker for wp_nav_menu()
Normal Wordpress Menu looks like:
Home | Blog | About us | Contact
But I've seen many pages with descriptions under these links:
Home Page | Our Blogs | About us
| ...
32
votes
6answers
4k views
framework for plugin/theme options panel? [closed]
I found that the longest part of a plugin or theme development is creating the options panel, at least in my case.
So i like to know what's your take on that.
Do you use a ready made framework or ...
32
votes
6answers
2k views
Best-of-Breed Features of a High-End WordPress Web Host? [closed]
I'm posting this as a community wiki because I'd like to get a collaboratively edited list of features for a high-end WordPress webhost.
For example, if you are running a high-traffic ...
29
votes
2answers
1k views
Do deactivated plugins slow down a WordPress site?
Most people are aware that minimizing the number of plugins used is a good way to help keep a WordPress site running fast. However, does that general rule include deactivated plugins?
28
votes
3answers
617 views
Does WordPress send data about your blog to WordPress.org or Automattic?
I've recently heard someone say WordPress does send data about your blog to back home. Is that true? and if so what data is that or where in the code can I see what's exchanged?
28
votes
3answers
2k views
Opinions and recommendations on the best barebones base theme [closed]
Preamble
I'm finding myself building more and more WP sites "from scratch" as it were (ie: ignoring any theme designs out there and just creating a design wireframe purely on the needs of the client. ...
27
votes
3answers
31k views
How can I add an image upload field directly to a custom write panel?
I've added a new page under "Pages" in the wordpress admin, and added several custom fields. I'd also like to be able to add an upload image field to the page editor - is there some way to do this via ...
26
votes
3answers
4k views
Are transients garbage collected?
This question got me thinking Transient RSS feeds in wp_options not removed automatically?
Transients are supposed to expire and be deleted. However the only way I see this handled is when transient ...
26
votes
8answers
4k views
What process do you use for WordPress development?
I'm interested in how other people develop themes and plugins for WordPress. To me, the in-browser editor in the admin panel just doesn't cut it. Currently, I'm just using an IDE with a PHP plugin ...
25
votes
13answers
981 views
How do you debug plugins?
I am pretty new to plugin authoring and was having a hard time debuging.
I used lots of echo and it is sloppy and ugly.
I am sure there is a better way to do this, maybe an IDE with a debugger that ...
25
votes
1answer
2k views
What's the preferred method of writing AJAX-enabled plugins?
I'm wondering what the preferred method is for dealing with AJAX calls. Should one use the same plugin php file to process the POST or a separate one? Which is cleaner or safer?
25
votes
1answer
1k views
Ajax takes 10x as long as it should/could
I have just hit my first serious issue with WordPress and for someone that enjoys Ajax this is a biggy.
I have an Ajax request that is taking 1.5 seconds to complete while using the Ajax API.
If I ...
24
votes
17answers
2k views
Where can I download WordPress themes from? [closed]
What sites offer WordPress themes to download? (Can be paid-for or free)
It's community wiki so if we had one site per answer, and with a little additional detail on each site, what sort of themes ...
24
votes
2answers
12k views
Uninstall, Activate, Deactivate a plugin: typical features & how-to
I'm making a wordpress plugin. What are typical things I should include in the uninstall feature?
For example, should I delete any tables I created in the install function?
Do I clean up my option ...
24
votes
10answers
11k views
Can I rename the wp-admin folder?
Is it possible to rename the wp-admin folder?
I know I could just rename it, but unless it's supported by the code lots of things would break.
If I use a custom folder name, it will make it slightly ...
24
votes
1answer
305 views
How to perform unit testing on proposed patches in Trac?
I was looking for some insight and good resources on how to correctly perform unit testing on proposed WordPress patches in the Trac and how to accurately report the results from the testing. I'm new ...
23
votes
6answers
8k views
Organizing Code in your WordPress Theme's functions.php File?
The more customization I make to WordPress the more I start thinking about if I should be organizing this file or splitting it up.
More specifically, if I have a bunch of custom functions which only ...
23
votes
4answers
11k views
How to sort the admin area of a Wordpress custom post type by a custom field
When editing one of my custom post types I want to be able to list all entries by a custom field instead of the date they are published (which, for a custom post type probably isn't relevant). I got a ...
23
votes
7answers
1k views
Getting Started with Subversion, Git, or similar Version Control System to keep a History of my Files? [closed]
I realize this may be a broad question on the surface, but I'm looking for specific examples of setups/workflows that people use to keep a version history of edited files on a WordPress site. For ...
22
votes
8answers
4k views
Why do I get comment spam even with Akismet and Captcha?
I'm a bit perplexed why I keep getting so many spam comments ...
Even though I use both the Akismet and WP-reCAPTCHA plugins on my WordPress blog!
WP-reCAPTCHA should stop machine entered spam, ...
22
votes
3answers
755 views
Best way to initiate a class in a WP plugin?
I've created a plugin, and of course being me, I wanted to go with a nice OO approach. Now what I've been doing is to create this class and then just below create an instance of this class:
class ...
21
votes
8answers
3k views
Local copy of WordPress Codex?
Sometimes I want to develop WordPress themes when I have no internet connection. I need the Function Reference and Template Tags to be productive.
I searched for a downloadable or SVN copy of the ...
21
votes
7answers
3k views
When Should we NOT Recommend a Client use WordPress?
As responsible professionals there has to be a line where we say, WordPress is not supposed to be used for that.
When is WordPress not the answer?
21
votes
6answers
2k views
Using OOP in themes
I see a lot of plugins making use of object-oriented coding when there isn't really necessary.
But what's even worse is that theme developers are starting to do the same thing. Commercial themes and ...
21
votes
5answers
2k views
Where Can I Find a List of WordPress Hooks?
Where can I find a list of all the WordPress hooks and over-ridable functions (pluggable, scriptable, etc)?
Edit: Plugin is here: ...
21
votes
4answers
4k views
Plupload Intergration in a meta-box?
I know that plupload is going to be the new upload engine for WordPress 3.3 but I was wondering if there is any documentation yet on how it integrates with WordPress.
My specifically how to collect ...
21
votes
4answers
2k views
What are PHP extensions and libraries WP needs and/or uses?
Codex loosely only mentions PHP version in server requirements, however PHP can be configured in pretty wide range of excluding/including different parts.
What are extensions/libraries that:
are ...
21
votes
8answers
4k views
User-friendly cropping of post thumbnails?
Is there a way to let my users define the crop area of a post thumbnail? The thumbnails always are existing post attachments, I would rather not create an extra attachment per thumbnail.
The post ...
20
votes
1answer
5k views
A tool to analyze rewrite rules? [closed]
Is there a good tool to analyze my rewrite rules? I always get confused with the regexes and the parameter replacements.
I have created something myself and will post it here so others can use it, ...
20
votes
1answer
1k views
Is there a plugin that provides a stackoverflow style editor for wordpress?
I am tired of the tinymce editor in wordpress and I really love the stackoverflow editor which allows me to write with markdown grammar. So I want to write blog with markdown in wordpress.
Now I am ...
20
votes
7answers
1k views
What Plugins Demonstrate Great WP Plugin Development?
I'm going to be tackling my first plugin soon and I'm looking for plugins which you feel are of very high quality, under the hood. Stuff I can use as an example while I design the framework for my ...