Modifications to theme and plugin files to create new functionality.

learn more… | top users | synonyms (10)

220
votes
108answers
100k 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 ...
69
votes
8answers
22k 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?
10
votes
2answers
8k 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 ...
2
votes
1answer
1k views

Check before publishing, if already exist post with current custom field value

I have a custom post type with only 3 custom fields in it. $post_types = get_post_meta($post->ID,'post_types',true); $post_taxonomies = get_post_meta($post->ID,'post_taxonomies',true); ...
17
votes
1answer
8k 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 ...
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 ...
6
votes
2answers
836 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 ...
1
vote
2answers
3k views

Multiple Domain Names - One WP Install (non-Multisite) - Default Each Domain name to Category Archive

Use case is somewhat simple - here goes: Five people share a single wordpress install - not multi-user Each person blogs and puts their posts in a their own unique category Each person has their ...
6
votes
4answers
3k 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 ...
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 ...
2
votes
2answers
3k views

Add a checkbox to post screen that adds a class to the title

I'm needing some posts to have different title colors than others, and I figured this would be most conveniently accomplished by some sort of check box on the post creation/edit screen. How would I go ...
0
votes
1answer
734 views

How to Use the Function is_user_logged_in To Display Different Menus?

So, I want to create different menus for people who are logged in or not. I got a reply that i should use a function if (is_user_logged_in()) { wp_name_menu(array('theme_location' => ...
0
votes
1answer
4k views

All-in-One Event Calendar: Custom Query - Getting each event Instance [closed]

I am using the All-in-One Event Calendar by Timely, and I would like to display upcoming events from the events calendar in a carousel on a separate page, and I need to get the event information. I ...
-1
votes
1answer
6k views

How To Customize Position of »add to cart« of WooCommerce on Product Page [closed]

Which file (or files, if more than one) do I need to edit to re-arrange the Product Page? I want to make some basic layout changes to the default Woocommerce product page. Specifically, I want to put ...
20
votes
6answers
10k 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 ...
8
votes
3answers
6k 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 ...
4
votes
2answers
13k 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?
4
votes
3answers
3k 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 ...
5
votes
1answer
255 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 ...
3
votes
1answer
700 views

How to set up sub-categories for author pages?

I am setting up Wordpress for a school. They want to enable teachers to have their own section of the site where they can create posts in different categories (assignments, events, etc). I know that ...
0
votes
2answers
3k views

Automatically wrap post image in div

In regards to image attachments inserted into a post, I would like to wrap the img tag inside a div tag for specific design purpose. Is there a way to do this automatically after attaching the image ...
1
vote
3answers
2k views

Any way to use a custom Parameter for youtube embed without using an iframe?

I do not want to display the titles of videos I embed on my wordpress site. The way I've been doing this is using the embed link, inserting the iframe in the wordpress post and adding the custom ...
0
votes
1answer
212 views

Wordpress in “Couch Mode”?

I am trying to setup a "Couch Mode" (distraction free reading) on my WordPress blog as laid out in this article. The guide in the article follows these steps: Create a new page in WordPress with ...
0
votes
1answer
558 views

Unattaching images from a post

I currently have a custom post type in a theme I'm developing which will be used for portfolio items. So far, I have implemented functionality that allows images to be attached to a portfolio post. I ...
-5
votes
1answer
518 views

What does this PHP function code mean? [closed]

Can someone please help me to understand each part of this code? Can you comment every line so I can understand and custom the code accordind to my purpose. Here is the link in pastebin: class ...
4
votes
1answer
4k 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 ...
36
votes
7answers
16k 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 ...
16
votes
9answers
4k 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 ...
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 ...
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 ...
5
votes
3answers
624 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 ...
3
votes
2answers
1k views

TV Show database - Best way for structuring it?

I want to make a TV Show database in Wordpress that has this URL format: /tvshows/friends/01/12/ /tvshows/ would list all series /tvshows/friends/ would list all the seasons available for Friends ...
2
votes
1answer
1k views

front end post with multiple upload images?

I am using front end post with upload image, my code if (!function_exists('wp_generate_attachment_metadata')){ require_once(ABSPATH . "wp-admin" . '/includes/image.php'); ...
4
votes
1answer
5k views

Customizing the Subject Field in WordPress' Notification Emails?

Can I customize and edit the subject field in the "Password Reset" notification mails sent from our multisite blogs? I have tried some plugins like My brand login and white label CMS etc. But I can't ...
3
votes
3answers
2k views

Removing fields from the Media Uploader/Gallery

I've been searching high and low for an answer. I simply want to remove the Alternate Text, Caption, Description and Link URL-fields from the uploader and gallery view. I seem that every thing else ...
3
votes
2answers
2k views

How can I hide a category from Contributors in the edit/add new post screen?

I have a situation where I need to hide a specific category and it's children from users who are logged in as Contributors. I don't want them to see this category and it's children in the categories ...
2
votes
2answers
3k views

WordPress Paginate $wpdb->get_results

Due to a complex multisite config, I have a query which combines the posts from two blogs and I would like to paginate the results. I am grateful for any help. I have posted my query. ...
2
votes
2answers
2k views

How do I create a featured post within a custom post type?

Do I do this exactly the same way as I would with normal posts? I use a $featured_cat global variable and pull that out. Should I do the same here? Or should I use an associated custom taxonomy? Or ...
4
votes
2answers
7k 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?
3
votes
2answers
945 views

How to make custom bulk actions work on the media/upload page?

I'm adapting a script I found online to add custom bulk actions to the screen with the list of posts. It has this line: add_action('load-edit.php', 'custom_bulk_action'); I'm trying to adapt it for ...
3
votes
4answers
18k views

Custom Post Types on Category Pages

I'm working with a custom post type that uses the normal WordPress categories. I am able to modify my category template to display my custom post types exactly how I want them. The problem is, once ...
3
votes
2answers
5k views

Adding Custom Fields to WordPress Comment Forms?

What is the best way to add custom fields to a WordPress comment form? (for example subject, image, etc...) And how do I use the data entered afterwards...
2
votes
4answers
2k 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() { ...
2
votes
1answer
2k views

how to redirect to a custom password retrieval page

I have a new site and I'm using bbpress beta-3 with it, I've created custom login/register/lost-password pages with the custom templates supplied with bbpress and I can't seem to find the ...
2
votes
1answer
4k views

add_rewrite_rule and custom variable

I have been wanting to do something similar like this for a long time. I have a url http://studionumberone.com/portfolio/obey-clothing/ which just shows the jquery gallery of images, I then have ...
1
vote
1answer
1k views

Custom Post Type Pagination Doesn't Work in Wordpress 3.4

I have a problem when using Wordpress 3.4. My "Products" custom post type pagination doesn't work. Here is the code I use $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $loop = new ...
1
vote
2answers
3k views

wordpress custom walker for thumbnails with custom menu

I'm still very novice at PHP so any help is greatly appreciated. Typically I have found the codex to be very helpful but it appears custom walkers may be outside its scope. I'd like to have ...
0
votes
4answers
4k views

Prevent duplicate posts in wp_insert_post using custom fields

My source links are something linke this : http://sample.com/entertainment/default.aspx?tabid=2305&conid=102950 http://sample.com/entertainment/default.aspx?tabid=2418&conid=104330 ...
0
votes
1answer
136 views

How-to inspect filter-able $vars?

Note: This is more of a tutorial/wiki than a real question and should be a reference for later Questions. If you got something to add, please feel free to add an answer. Working answers get upvoted. ...
2
votes
4answers
3k views

Custom Walker: how to get ID in function start_lvl

I am making my first custom walker to build an accordion menu. To start with I used this example: http://bitacre.com/2025/custom-nav-menu-walker-for-wordpress-themes There are two functions. First ...