Modifications to theme and plugin files to create new functionality.

learn more… | top users | synonyms (9)

207
votes
108answers
88k 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 ...
67
votes
9answers
18k 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?
34
votes
7answers
13k 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 ...
20
votes
6answers
8k 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 ...
17
votes
1answer
6k 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 (ie supplier_name). I would like to be able to search and filter my posts ...
15
votes
9answers
3k 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 ...
12
votes
3answers
2k views

Customizing a WordPress theme without changing it?

I have found and downloaded a theme. However I want to tweak the CSS some to change the design, colours etc. a bit. How should I go about doing this, while still being able to update the theme without ...
12
votes
2answers
522 views

New WP_Customize API - how does it work under the hood?

I noticed that if you make changes trough the new "customize" feature, when you navigate on a different page within the iframe preview document, your changes still apply, even if they are unsaved. It ...
10
votes
4answers
179 views

What do you think about custom designed plugin/theme options UIs?

You probably noticed the trend of making custom designed plugin/theme options UIs, especially in the commercial ones (on CodeCanyon for example - custom boxes, tabs, accordions etc). I personally ...
10
votes
2answers
7k 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 ...
10
votes
2answers
609 views

Specific upload folder for PDFs in custom Post type in WP multisite

I need to filter uploads to a specific folder for a custom-post type called "document" only for PDFs. So far, I have: function custom_upload_directory( $args ) { $base_directory = ...
8
votes
3answers
5k views

Validating Custom Meta Box Values & Required Fields

Something which I have never seen covered is the best way to validate that specific form fields are filled out correctly for custom post type meta boxes. I am looking to get expert opinions on how ...
8
votes
1answer
1k views

Add button to TinyMCE bar without creating a plugin

I'm trying to add a custom button or two to the TinyMCE rich text editor. The tutorials I've seen so far are either outdated or explain how to do it with a custom plugin. How can I do this without ...
6
votes
7answers
198 views

I'm looking for some good references (manuals)

I started a blog recently. Currently I'm using a free theme and some plugins that are working well enough for now. And, my overall goal is to produce content and not become a WordPress developer, etc. ...
6
votes
4answers
2k views

How do I append multiple taxonomies to the URL?

Multiple taxonomies in URL How does one append multiple taxonomies to the URL having the following: Post Type: products Taxonomy: product_type Taxonomy: product_brand Adding new ...
6
votes
2answers
746 views

Looking for a Table of Contents (TOC) plugin for WordPress

I am looking for a simple TOC plugin for WordPress that would create a ToC similar to the one from MediaWiki (Wikipedia). Usually I need this only for big pages and the TOC needs to be generated based ...
6
votes
2answers
4k views

Getting Post Comments for post ID using WP_Query() and a Custom Loop?

(Moderator's note: The original title was "Is there a way to get post comments by post ID on a custom loop using WP-Query()?") Hi! I'm running a custom loop using WP_Query, that only displays one ...
6
votes
4answers
304 views

Seamless integration between WordPress and BBpress

I have a WordPress site at domain.com and a BBPress install at domain.com/subfolder the wp site has a menu item that goes to the forums, and I'd like the header to be the same between the two, so that ...
6
votes
1answer
318 views

Custom Post Types, slug, archive and SEO plugins

I made a custom post type called "friends". I am able to correctly list my friends using this urls: http://mysite/friends/friend1/ http://mysite/friends/friend2/ http://mysite/friends/friend3/ ...
6
votes
1answer
419 views

Search Custom Post Type Pages and Custom Fields in 2 Dropdowns?

On my custom post type pages I have custom fields that the user can edit. What I want is to have a search form with 2 select dropdowns: one dropdown that is populated with all the top-level custom ...
5
votes
5answers
363 views

Updating WordPress overwriting customization tweaks - strategies?

Twice now I've updated wordpress, only to realise that (facepalm) it overwrites some changes I've made to the custom template - to sidebar or something similar. Obviously I don't HAVE to update, ...
5
votes
2answers
156 views

What is the best way to customise admin files so they survive future upgrades?

I have a site with some custom post types, one of which doesn't have a title. When viewed in the admin section, the posts are listed like so Which is less than ideal, for obvious reasons. I have ...
5
votes
2answers
383 views

What are the ADVANTAGES of ORIGINAL wordpress template structure?

Precondition: coming from a Custom PHP applications(using symfony, zend and so on) world, for me it feels unnatural to have template separated in a way that is done in original wordpress theme. e.g ...
5
votes
3answers
1k views

Change admin bar to default:off

While I quite like the admin bar I actually want it to be OFF by default instead of ON ( I don't want to disable it altogether because I want users to be able to turn it on if they want - but but I ...
5
votes
5answers
7k 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 ...
5
votes
2answers
2k views

How to Change 404 page title

i have try many methods after searching on internet but unable to ramove Nothing Found from my 404 page title how to do it please help me even i have us this in my 404 page header if( is_404() ) ...
5
votes
5answers
1k views

Add separator to admin submenu

I would like to add a separator to the admin submenu section, NOT in the top level section. I'm thinking of using javascript and styling to do the job, but I was wondering if there's a more ...
5
votes
1answer
1k views

Get a button for <hr> in the Editor

Somehow the WordPress editor doesn't have a button to insert a horizontal line (<hr /> in html). Is there a plugin that adds this button? Or an easy way to add such a button myself?
5
votes
1answer
229 views

When is it appropriate to create a new table in the WordPress database?

For a client we'll need 29,000 terms (all the highschool's in the US) and each term needs 6 meta items (address, phone...). My initial thought was to store the term meta information as suggested in ...
5
votes
1answer
118 views

Multiple Inputs in a Customizer Control

Say I have a single custom control, but this control has 2 inputs that require saving, e.g.: Currency type and value Size and unit of measurement First and last name Text and style Image and image ...
5
votes
3answers
428 views

Localization: I want the backend: english and frontend in defined language

I'd like to have the backend of Wordpress in English and use a different locale for the frontend so far I figure out perhaps I could do it by setting in the wpconfig the locale I want to use in the ...
5
votes
1answer
2k views

Styling Shortcodes in Visual Editor

Does anyone know how to style the visual editor so that when specific shortcodes are used they are replaced with an image within the visual editor? I have found that many users screw up the shortcode ...
5
votes
1answer
300 views

Limit Media Library to Given Folder

I have made a plugin that uses the Media Library to allow users to upload files to a specific directory - using the upload_dir filter. I would like to know if there is a way (i.e. a filter) I can use ...
5
votes
2answers
149 views

Template for individual post designs

I browsed through the suggested posts, and couldn't find anything that was exactly answering my question. I apologize in advance if I'm reposting something obvious here, but there you have it. I want ...
5
votes
1answer
305 views

Custom ReCaptcha Login

I'm trying to add ReCaptcha to my login page. I know there are many many plugins by per request I cannot use plugins. So far so good, I'm able to add the Captcha to my login but unable to show errors. ...
5
votes
1answer
268 views

Wordpress Permalink changes to question mark (?) in URL

My Permalink custom url is /%post_id%/%postname%/ and my website is in Persian language, for some posts the Permalink is change in URL from ...
4
votes
2answers
5k views

How to edit a wordpress plugin without break its update process

I would like to add some additional features/functionality with already available WordPress plugin. Is it possible to carry over my customization while updating the plugin?
4
votes
3answers
2k views

Make Custom Metaboxes Collapse by Default

I've created some custom metaboxes for my post write screen. Is there any way to make some of them display collapsed by default? Just in case I'm not using the correct terms or not being clear in ...
4
votes
2answers
1k views

Is it possible to change the attributes of a registered style or script before it fires?

I'd like to modify the properties of a registered style(or script - same applies) before it's been loaded. Right now i'm trying to modify a registered style just before it gets enqueued, so i can ...
4
votes
5answers
2k views

Change the login button on the login page

I would like to be able to change the text on the Log In button in wp-login.php - however, it's a bit more complicated than that. I want to be able to change it in the theme, rather than editing the ...
4
votes
3answers
254 views

Is it possible to switch the data layer within WordPress?

WordPress is undoubtely very customizable using plugins, but every customization possibility surely has limits defined by the underlying architecture. For those familiar with WP architecture and ...
4
votes
6answers
5k views

Custom order of terms for custom taxonomy in admin and website

I have a custom taxonomy registered for my custom post type. I need to make it possible for a user to specify the order in which the taxonomy terms should appear (something like menu order for pages). ...
4
votes
1answer
2k views

Linking Two Post Types

and thanks in advance for your help. I've done some searching, and this question has been answered a couple of times with reference to the "posts 2 posts" plugin, but the documentation on that is ...
4
votes
1answer
3k views

Search multiple custom fields by using meta_query

I'm trying to create a search results listing for a custom post type and the problem I'm running in to is with the way the 'meta_query' parameter is stringing the passed values together. It appears ...
4
votes
3answers
2k views

Removing Metabox for “Slug” without removing functionality

Here is an interesting question. I have recently noticed that if you utilize the code remove_meta_box('slugdiv', 'post', 'normal'); you are actually unable to modify the slug when you click on ...
4
votes
1answer
217 views

Adding another state (spam, reject, approve) to wordpress comments?

i know this might sound a bit weird, but what I'm trying to do is rather simple in mind but may be technically difficult. I'm running small contests on my wordpress site where I ask users to leave a ...
4
votes
3answers
3k views

Wordpress Multiple Category Search

From few months I am digging into wordpress for multiple category search options, and finally came up with this. I just found that wordpress allows multiple tags, which means that if in your URL you ...
4
votes
1answer
948 views

How to hide or remove unwanted widgets on Multisite installation?

I am using Multi-site installation. I don't want all the widgets appear under widgets.php on dashboard .So I tried to find a way to remove or hide unnecessary widgets . SO that the new sub-sites ...
4
votes
1answer
286 views

How can I save an array from a random post sequence for later use?

I'm building a random workout generator on Wordpress to help with my fitness, and am stuck at saving random post arrays for later reference. I'll explain. The generator should work in two main ...
4
votes
2answers
7k 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?