Questions tagged [customization]
MEANINGLESS tag. Used as a merge target for other meaningless tags. Do not use it on new questions.
5,080
questions
346
votes
108
answers
168k
views
Best collection of code for your 'functions.php' file [closed]
As with many others who are now viewing this post, I have been reading various blogs, forums, and discussion groups to learn and improve my WordPress skills. Over the past 12 months I have been on a ...
214
votes
27
answers
62k
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 ...
155
votes
10
answers
74k
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 ...
152
votes
13
answers
57k
views
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?
EDIT- Important security note:
Please understand ...
138
votes
36
answers
18k
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 ...
108
votes
8
answers
78k
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 ...
76
votes
3
answers
56k
views
When to use is_home() vs is_front_page()?
I've found that is_front_page appears to return true when I'm viewing the home page and have a single sticky post assigned there.
It also returns true when I've assigned a page as the static front ...
70
votes
5
answers
50k
views
Is there a flowchart for WordPress loading sequence?
So like WP must load series of files from,
index.php -> ... -> wp-header.php -> ... ->functions.php
...and so on upon execution.
Also there must be a similar flowchart for functions ...
65
votes
7
answers
19k
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 ...
64
votes
3
answers
153k
views
How to change the default registration email ? (plugin and/or non-plugin)
After a new user registration, WP sends out an email with the login / password, and a link to the login page.
Is there a way to change this defaut email template? I'd also like to change the subject ...
61
votes
5
answers
78k
views
MySQL Database User: Which Privileges are needed?
The short installation instruction for WordPress ("5 Minutes") state that:
Create a database for WordPress on your web server, as well as a MySQL user who has all privileges for accessing and ...
58
votes
2
answers
107k
views
How to put logs in WordPress
Is there any way that I can log anything in WordPress similar to logs we can do it in Magento?
I am integrating a custom plugin in that I have added few functions with help of hooks, So I need to ...
55
votes
6
answers
3k
views
Essential technical features for high-end WordPress web hosting? [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 WordPress-...
54
votes
8
answers
234k
views
How to create a custom search for custom post type?
I have a search field for the blog posts, but I need an other for a custom post type. How can I create this custom search form with a different search result layout?
54
votes
10
answers
30k
views
How to structure a plugin
This isn't a question about how to build a WordPress plugin. Rather, what, if any, guides could be applied to how to put together the file architecture of any plugin.
Some other programming languages ...
52
votes
7
answers
105k
views
How to remove admin menu pages inserted by plugins?
I've got the following code, which cleans up a lot of stuff that is not going to be used within the admin area:
add_action( 'admin_menu', 'my_remove_menu_pages' );
function my_remove_menu_pages() {
...
44
votes
3
answers
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. ...
41
votes
12
answers
21k
views
What is your best practice to execute one-time scripts?
The Problem
We all have been in a situation like this, and a lot of questions on this site need a solution like this. You either have to update a database, insert a lot of data automatically, convert ...
41
votes
1
answer
28k
views
How to filter post listing (in WP dashboard posts listing) using a custom field (search functionality)?
Despite the fact I googled a lot, I've not found the answer to a very simple question :
I have some posts with a custom field (i.e. supplier_name). I would like to be able to search and filter my ...
41
votes
7
answers
17k
views
Conditionally Loading JavaScript/CSS for Shortcodes
I released a plugin that creates a shortcode and requires a JavaScript file and a CSS file to load on any page that contains that shortcode. I could just make the script/style load on all pages, but ...
40
votes
3
answers
44k
views
How to get the Date Format and Time Format settings for use in my template?
This is a strange question, but I want to know how I can access the Date and Time settings
Admin > Settings > General > Date Format
Admin > Settings > General > Time Format
I am ...
38
votes
4
answers
82k
views
what is the correct way to compare dates in a WP query_posts meta_query
I have a query_posts call in a WP template. Through the use of the More Fields Plugin I can give the site admin the ability to create an event (custom post type) and then enter a date which is ...
37
votes
2
answers
10k
views
Explanation of update_post_(meta/term)_cache
I was reading over some best practices from 10up and they mention setting these two flags to false in a WP_Query ( depending on what you're querying ):
'update_post_meta_cache' => false: useful ...
37
votes
4
answers
15k
views
Database synchronization between dev/staging and production
I have a problem with WordPress database synchronization between development and production and I am wondering how other people solving it. I am aware about this question but it doesn't really cover ...
33
votes
4
answers
1k
views
How to implement a customizable free OpenID authentication?
OpenID is a standard commonly used nowadays. I am trying to implement OpenID on my blog, but I have many difficulties.
I tried OpenID plugin but it seems to be incompatible with Wordpress 3.0.
I ...
32
votes
9
answers
38k
views
Best way to eliminate xmlrpc.php?
What is a best way to eliminate xmlrpc.php file from WordPress when you don't need it?
32
votes
2
answers
57k
views
Add multiple custom fields to the general settings page
What I would like to do is to add a few custom fields to the general settings.
This is the code that I'm using. It works alright but I just cant figure how to add more fields.
I would like to create ...
31
votes
3
answers
89k
views
Nested meta_query with multiple relation keys
I am curious whether Wordpress is able to run nested meta_query, with each having different relation keys? As of Wordpress 3.0, tax_query is able to perform this function; I'm wondering whether this ...
31
votes
5
answers
3k
views
Should all plugins be encapsulated in a Class?
When developing a plugin should the functions be grouped together into a Class to avoid namespace conflicts?
Does using classes create performance overheads for PHP?
If there is a performance hit, ...
31
votes
7
answers
36k
views
Add validation and error handling when saving custom fields?
I have a function that defines a custom field on a post type. Say the field is "subhead".
When the post is saved, I want to do some validation on the input, and display an error message on the post ...
30
votes
2
answers
44k
views
Where are Additional CSS files stored
This image shows the Additional CSS feature in Wordpress. I'm trying to find the file that stores the additional CSS, but can't seem to find it anywhere - I've searched almost every folder in wp-...
30
votes
2
answers
34k
views
How To Add Custom Form Fields To The User Profile Page?
The user profile page has the following fields:
Username
First Name
Last Name
Nickname
Display name
Contact Info
E-mail
Website
AIM
Yahoo IM
Jabber / Google Talk
How can more fields be added to ...
29
votes
7
answers
170k
views
What SQL Query to do a simple find and replace
Whenever I create a new website I first create a staging site on a subdomain like "stage.domain-name.com".
After everything works correctly I export the database, open it in notepad++ and do a find/...
28
votes
10
answers
32k
views
is_plugin_active function doesn't exist
I'm using WordPress 3.0.5 and have tested with 3.1rc4. In the main PHP file of my plugin, when I try to call is_plugin_active I get Call to undefined function is_plugin_active(). I can call add_action ...
28
votes
5
answers
59k
views
How can I edit post data before it is saved?
I have a plugin and I would like to be able to run the post content through some filters before it is saved to the database. From looking at the plugin api, I see that two hooks that look like they ...
28
votes
14
answers
703
views
What Features would you Most Like to See Added to WordPress? [closed]
I'm creating a community wiki to ask the following question:
What features would you most like to see added to WordPress?
This Question Implies a Few Things:
It should surface the features ...
28
votes
5
answers
3k
views
Why have <?php and ?> on every line
I've seen this convention pretty much everywhere, and, at times, it comes close to driving me nuts:
<?php //The loop ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php ...
27
votes
4
answers
12k
views
add_action(), add_filter() before or after function
When looking through WordPress snippets/tutorials/plugins I often see add_action() and add_filter() being placed before the function is declared:
add_action( 'publish_post', 'email_friends' );
...
26
votes
3
answers
33k
views
How do i best handle custom plugin page actions?
I'm constantly running into the same annoyance, so i thought i'd see if there's any ideas or experience out there...
I've created a plugin that uses it's own admin page. It has to. Now that i sorted ...
26
votes
2
answers
48k
views
numberposts? showposts? posts_per_page?
So the documentation on the Codex is pretty clear that showposts is deprecated. But that same documentation mentions nothing of numberposts. Instead, posts_per_page is listed.
But if we turn to the ...
23
votes
3
answers
44k
views
Attaching taxonomy data to post with wp_insert_post
I am trying to implement a front end posting system which shows taxonomy data in several dropdown select fields. Each of the dropdowns is named by using the "name" $arg in wp_dropdown_categories().
...
23
votes
6
answers
45k
views
Proper Way to Modify Plugin
What is the best way to modify a plugin? I frequently want to make small changes to one or two functions within a large plugin. This is easily done, but I have to use comments to mark my changes and ...
23
votes
2
answers
32k
views
Difference between add_filter and apply_filters
I have searched for a suitable explanation of the difference between add_filter() and apply_filters() in here but couldn't find one.
Can anyone tell me what information or logic to consider before ...
23
votes
3
answers
3k
views
Best Practices for Regression Testing WordPress Websites?
Hi all,
I'd like to hear what others who are delivering complex non-blog solutions to clients with WordPress as a platform what they are using for automated Regression Testing?
For those not ...
22
votes
6
answers
52k
views
Remove wrapping div and ul from output of wp_nav_menu
I am using the new menu system of Wordpress, and here is the result of wp_nav_menu()
<div class="menu-main-menu-container">
<ul id="menu-main-menu" class="menu">
<li id="menu-...
22
votes
3
answers
11k
views
What Is The Use Of map_meta_cap Filter?
What is the use of map_meta_cap filter? This filter is not documented anywhere. I have an unclear idea of what it could be:
Used to map the permissions of the user to operations on posts.
What ...
22
votes
5
answers
8k
views
How do you use a CPT as the default home page?
I have a client who's site will be making heavy use of custom post types to configure their site. But I'm between a rock and a hard place for their requested home page.
In reality, the home page ...
22
votes
1
answer
2k
views
How to create an API for my plugin?
I have been developing plugins for WordPress, most plugins I have developed use two or three classes, hence not as huge as Buddypress or WooCommerce.
I am planning to develop two open source plugins ...
22
votes
2
answers
1k
views
Is it ever okay to include inline CSS in plugins?
Normally in a plugin I would add styles using wp_enqueue_style. However, I am currently creating a plugin that only needs a few lines of CSS and I am wondering if it might be better to serve the ...
22
votes
4
answers
4k
views
Plugins in symlinked directories?
When I develop plugins I test them on multiple versions of WordPress by symlinking my plugin directory in the different wp-content directories. This is great since I only have to edit the files once, ...